From 9209c1295cd2a64dcb57fb295f9f2e1edf952ba7 Mon Sep 17 00:00:00 2001 From: David Lantner Date: Wed, 10 Feb 2016 08:58:51 -0500 Subject: [PATCH 01/63] "intellisence" to "IntelliSense" Correct spelling of IntelliSense. --- angular1/CONVERSION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular1/CONVERSION.md b/angular1/CONVERSION.md index 8970a0a..1af6199 100644 --- a/angular1/CONVERSION.md +++ b/angular1/CONVERSION.md @@ -8,4 +8,4 @@ The following is the list of modifications made to change the JS project to a TS * Remove `$` from `jquery.d.ts` in `e2e-tests`. * Remove `protractor` def from `app`. -You will notice that stuff like `angular`, `mocks` etc will light up with intellisence and you will get errors if you try to misuse these. \ No newline at end of file +You will notice that stuff like `angular`, `mocks` etc will light up with IntelliSense and you will get errors if you try to misuse these. From b0d279d1ff26a268eb5b635cc33078a3d4e5baaa Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sun, 14 Feb 2016 21:09:29 +0000 Subject: [PATCH 02/63] Update dependencies --- es6-babel-react-flux-karma/gulp/.eslintrc | 128 ++++++++++++---------- es6-babel-react-flux-karma/gulp/tests.js | 2 +- es6-babel-react-flux-karma/karma.conf.js | 2 +- es6-babel-react-flux-karma/package.json | 15 +-- es6-babel-react-flux-karma/tsd.json | 14 +-- 5 files changed, 88 insertions(+), 73 deletions(-) diff --git a/es6-babel-react-flux-karma/gulp/.eslintrc b/es6-babel-react-flux-karma/gulp/.eslintrc index d5833b1..e91bbce 100644 --- a/es6-babel-react-flux-karma/gulp/.eslintrc +++ b/es6-babel-react-flux-karma/gulp/.eslintrc @@ -1,59 +1,73 @@ { - "root": true, - "env": { - "commonjs": true, - }, - "rules": { - "no-alert": 2, - "no-array-constructor": 2, - "no-caller": 2, - "no-catch-shadow": 2, - "no-empty-label": 2, - "no-eval": 2, - "no-extend-native": 2, - "no-extra-bind": 2, - "no-implied-eval": 2, - "no-iterator": 2, - "no-label-var": 2, - "no-labels": 2, - "no-lone-blocks": 2, - "no-loop-func": 2, - "no-multi-str": 2, - "no-native-reassign": 2, - "no-new": 2, - "no-new-func": 2, - "no-new-object": 2, - "no-new-wrappers": 2, - "no-octal-escape": 2, - "no-proto": 2, - "no-return-assign": 2, - "no-script-url": 2, - "no-sequences": 2, - "no-shadow": 2, - "no-shadow-restricted-names": 2, - "no-spaced-func": 2, - "no-trailing-spaces": 1, - "no-undef-init": 2, - "no-unused-expressions": 2, - "no-use-before-define": [2, "nofunc"], - "no-with": 2, - "camelcase": 2, - "comma-spacing": 1, - "consistent-return": 2, - "curly": [2, "all"], - "dot-notation": [2, { "allowKeywords": true }], - "eol-last": 2, - "no-extra-parens": [2, "functions"], - "eqeqeq": 2, - "new-cap": 2, - "new-parens": 2, - "quotes": [1, "single"], - "semi": 2, - "semi-spacing": [2, {"before": false, "after": true}], - "space-infix-ops": 2, - "space-return-throw-case": 2, - "space-unary-ops": [2, { "words": true, "nonwords": false }], - "strict": [2, "global"], - "yoda": [2, "never"] - } + "root": true, + "env": { + "commonjs": true, + }, + "rules": { + "camelcase": 2, + "comma-spacing": 1, + "consistent-return": 2, + "curly": [ 2, "all" ], + "dot-notation": [ + 2, + { "allowKeywords": true } + ], + "eol-last": 2, + "eqeqeq": 2, + "keyword-spacing": 2, + "new-cap": 2, + "new-parens": 2, + "no-alert": 2, + "no-array-constructor": 2, + "no-caller": 2, + "no-catch-shadow": 2, + "no-eval": 2, + "no-extend-native": 2, + "no-extra-bind": 2, + "no-extra-parens": [ 2, "functions" ], + "no-implied-eval": 2, + "no-iterator": 2, + "no-labels": 2, + "no-label-var": 2, + "no-lone-blocks": 2, + "no-loop-func": 2, + "no-multi-str": 2, + "no-native-reassign": 2, + "no-new": 2, + "no-new-func": 2, + "no-new-object": 2, + "no-new-wrappers": 2, + "no-octal-escape": 2, + "no-proto": 2, + "no-return-assign": 2, + "no-script-url": 2, + "no-sequences": 2, + "no-shadow": 2, + "no-shadow-restricted-names": 2, + "no-spaced-func": 2, + "no-trailing-spaces": 1, + "no-undef-init": 2, + "no-unused-expressions": 2, + "no-use-before-define": [ 2, "nofunc" ], + "no-with": 2, + "quotes": [ 1, "single" ], + "semi": 2, + "semi-spacing": [ + 2, + { + "before": false, + "after": true + } + ], + "space-infix-ops": 2, + "space-unary-ops": [ + 2, + { + "words": true, + "nonwords": false + } + ], + "strict": [ 2, "global" ], + "yoda": [ 2, "never" ] + } } diff --git a/es6-babel-react-flux-karma/gulp/tests.js b/es6-babel-react-flux-karma/gulp/tests.js index 655ad18..4d6ba04 100644 --- a/es6-babel-react-flux-karma/gulp/tests.js +++ b/es6-babel-react-flux-karma/gulp/tests.js @@ -12,7 +12,7 @@ module.exports = { singleRun: false, // Fancy runner - plugins: ['karma-webpack', 'karma-jasmine', 'karma-mocha-reporter', /*'karma-junit-reporter', 'karma-coverage', */'karma-sourcemap-loader', 'karma-phantomjs-launcher', 'karma-phantomjs-shim'], // karma-phantomjs-shim only in place until PhantomJS hits 2.0 and has function.bind + plugins: ['karma-webpack', 'karma-jasmine', 'karma-mocha-reporter', /*'karma-junit-reporter', 'karma-coverage', */'karma-sourcemap-loader', 'karma-phantomjs-launcher'], reporters: ['mocha'] }; diff --git a/es6-babel-react-flux-karma/karma.conf.js b/es6-babel-react-flux-karma/karma.conf.js index b3c8afe..10ffba7 100644 --- a/es6-babel-react-flux-karma/karma.conf.js +++ b/es6-babel-react-flux-karma/karma.conf.js @@ -16,7 +16,7 @@ module.exports = function(config) { port: 9876, - frameworks: [ 'jasmine', 'phantomjs-shim' ], + frameworks: [ 'jasmine' ], logLevel: config.LOG_INFO, //config.LOG_DEBUG diff --git a/es6-babel-react-flux-karma/package.json b/es6-babel-react-flux-karma/package.json index 51f136b..9e81fe5 100644 --- a/es6-babel-react-flux-karma/package.json +++ b/es6-babel-react-flux-karma/package.json @@ -33,20 +33,20 @@ "babel-preset-es2015": "^6.0.0", "babel-preset-react": "^6.0.0", "del": "^2.0.2", - "eslint": "^1.6.0", + "eslint": "^2.0.0", "express": "^4.13.3", "flux": "^2.0.3", - "glob": "^5.0.15", + "glob": "^7.0.0", "gulp": "^3.9.0", "gulp-autoprefixer": "^3.1.0", "gulp-cached": "^1.1.0", "gulp-cssmin": "^0.1.7", - "gulp-eslint": "^1.0.0", + "gulp-eslint": "^2.0.0", "gulp-if": "^2.0.0", "gulp-inject": "^3.0.0", "gulp-notify": "^2.2.0", "gulp-sourcemaps": "^1.5.2", - "gulp-streamify": "1.0.0", + "gulp-streamify": "1.0.2", "gulp-uglify": "^1.2.0", "gulp-util": "^3.0.6", "jasmine-core": "^2.3.4", @@ -55,15 +55,16 @@ "karma-jasmine": "^0.3.6", "karma-junit-reporter": "^0.3.7", "karma-mocha-reporter": "^1.1.1", - "karma-phantomjs-launcher": "^0.2.1", + "karma-phantomjs-launcher": "^1.0.0", "karma-phantomjs-shim": "^1.1.1", "karma-sourcemap-loader": "^0.3.6", "karma-webpack": "^1.7.0", - "phantomjs": "^1.9.17", + "phantomjs": "^2.1.3", + "phantomjs-prebuilt": "^2.1.4", "react": "^0.14.3", "react-addons-test-utils": "^0.14.3", "react-dom": "^0.14.3", - "ts-loader": "^0.7.1", + "ts-loader": "^0.8.1", "typescript": "^1.6.2", "webpack": "^1.12.2", "webpack-notifier": "^1.2.1" diff --git a/es6-babel-react-flux-karma/tsd.json b/es6-babel-react-flux-karma/tsd.json index faf9987..2716a22 100644 --- a/es6-babel-react-flux-karma/tsd.json +++ b/es6-babel-react-flux-karma/tsd.json @@ -6,22 +6,22 @@ "bundle": "typings/tsd.d.ts", "installed": { "jasmine/jasmine.d.ts": { - "commit": "fa04c80f4a889613b96cb4f283848c61a9f64233" + "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" }, "flux/flux.d.ts": { - "commit": "fa04c80f4a889613b96cb4f283848c61a9f64233" + "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" }, "node/node.d.ts": { - "commit": "fa04c80f4a889613b96cb4f283848c61a9f64233" + "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" }, "react/react.d.ts": { - "commit": "fa04c80f4a889613b96cb4f283848c61a9f64233" + "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" }, "react/react-dom.d.ts": { - "commit": "fa04c80f4a889613b96cb4f283848c61a9f64233" + "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" }, "react/react-addons-test-utils.d.ts": { - "commit": "fa04c80f4a889613b96cb4f283848c61a9f64233" - } + "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" + } } } From 9a98b366d1cfc62d0dc5595d03a46b24bdd9c6a6 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Tue, 16 Feb 2016 06:23:59 +0000 Subject: [PATCH 03/63] Remove use React as an expression --- es6-babel-react-flux-karma/package.json | 8 ++++---- es6-babel-react-flux-karma/src/main.tsx | 1 - es6-babel-react-flux-karma/test/components/App.tests.tsx | 1 - .../test/components/Greeting.tests.tsx | 1 - .../test/components/WhoToGreet.tests.tsx | 1 - 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/es6-babel-react-flux-karma/package.json b/es6-babel-react-flux-karma/package.json index 9e81fe5..04d8f90 100644 --- a/es6-babel-react-flux-karma/package.json +++ b/es6-babel-react-flux-karma/package.json @@ -14,9 +14,9 @@ "url": "git+https://github.com/microsoft/typescriptsamples.git" }, "keywords": [ - "Globalize", - "globalization", - "internationalization", + "React", + "Flux", + "ES6", "typescript" ], "author": "John Reilly", @@ -65,7 +65,7 @@ "react-addons-test-utils": "^0.14.3", "react-dom": "^0.14.3", "ts-loader": "^0.8.1", - "typescript": "^1.6.2", + "typescript": "^1.8.0", "webpack": "^1.12.2", "webpack-notifier": "^1.2.1" } diff --git a/es6-babel-react-flux-karma/src/main.tsx b/es6-babel-react-flux-karma/src/main.tsx index aaea3ea..1e14a73 100644 --- a/es6-babel-react-flux-karma/src/main.tsx +++ b/es6-babel-react-flux-karma/src/main.tsx @@ -2,6 +2,5 @@ import 'babel-polyfill'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; import App from './components/App'; -React; // use React as an expression to prevent React being purged from dependencies as not used directly ReactDOM.render(, document.getElementById('content')); diff --git a/es6-babel-react-flux-karma/test/components/App.tests.tsx b/es6-babel-react-flux-karma/test/components/App.tests.tsx index 2488d1d..1530e64 100644 --- a/es6-babel-react-flux-karma/test/components/App.tests.tsx +++ b/es6-babel-react-flux-karma/test/components/App.tests.tsx @@ -4,7 +4,6 @@ import App from '../../src/components/App'; import WhoToGreet from '../../src/components/WhoToGreet'; import Greeting from '../../src/components/Greeting'; import GreetingStore from '../../src/stores/GreetingStore'; -React; // use React as an expression to prevent React being purged from dependencies as not used directly describe('App', () => { it('renders expected HTML', () => { diff --git a/es6-babel-react-flux-karma/test/components/Greeting.tests.tsx b/es6-babel-react-flux-karma/test/components/Greeting.tests.tsx index ddb1eb7..9ea44b4 100644 --- a/es6-babel-react-flux-karma/test/components/Greeting.tests.tsx +++ b/es6-babel-react-flux-karma/test/components/Greeting.tests.tsx @@ -2,7 +2,6 @@ import * as React from 'react'; import * as TestUtils from 'react-addons-test-utils'; import Greeting from '../../src/components/Greeting'; import * as GreetingActions from '../../src/actions/GreetingActions'; -React; // use React as an expression to prevent React being purged from dependencies as not used directly describe('Greeting', () => { let handleSelectionChangeSpy: jasmine.Spy; diff --git a/es6-babel-react-flux-karma/test/components/WhoToGreet.tests.tsx b/es6-babel-react-flux-karma/test/components/WhoToGreet.tests.tsx index 292f075..e514ec3 100644 --- a/es6-babel-react-flux-karma/test/components/WhoToGreet.tests.tsx +++ b/es6-babel-react-flux-karma/test/components/WhoToGreet.tests.tsx @@ -2,7 +2,6 @@ import * as React from 'react'; import * as TestUtils from 'react-addons-test-utils'; import WhoToGreet from '../../src/components/WhoToGreet'; import * as GreetingActions from '../../src/actions/GreetingActions'; -React; // use React as an expression to prevent React being purged from dependencies as not used directly describe('WhoToGreet', () => { let handleSelectionChangeSpy: jasmine.Spy; From a4320df7ae0c77bb6df5d6f8bd96f6606567f4f9 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 25 Feb 2016 17:40:34 -0800 Subject: [PATCH 04/63] Removed Windows 8.1 sample. --- win8.1/README.md | 16 - win8.1/encyclopedia/Encyclopedia.sln | 46 - .../Encyclopedia/Encyclopedia.jsproj | 117 - .../encyclopedia/Encyclopedia/css/default.css | 181 - .../Encyclopedia/css/groupDetailPage.css | 173 - .../Encyclopedia/css/groupedItemsPage.css | 140 - .../Encyclopedia/css/itemDetailPage.css | 103 - .../Encyclopedia/css/wikipedia.css | 283 - win8.1/encyclopedia/Encyclopedia/default.html | 34 - .../Encyclopedia/html/groupDetailPage.html | 50 - .../Encyclopedia/html/groupedItemsPage.html | 45 - .../Encyclopedia/html/itemDetailPage.html | 41 - .../Encyclopedia/images/ep-badge.bmp | Bin 158 -> 0 bytes .../Encyclopedia/images/ep-badge.png | Bin 194 -> 0 bytes .../Encyclopedia/images/ep-logo-small.png | Bin 491 -> 0 bytes .../Encyclopedia/images/ep-logo.png | Bin 3540 -> 0 bytes .../Encyclopedia/images/ep-splashscreen.png | Bin 14965 -> 0 bytes .../Encyclopedia/images/ep-storelogo.png | Bin 999 -> 0 bytes .../Encyclopedia/images/ep-widetile.png | Bin 7011 -> 0 bytes win8.1/encyclopedia/Encyclopedia/js/data.ts | 117 - .../encyclopedia/Encyclopedia/js/default.ts | 82 - .../Encyclopedia/js/groupDetailPage.ts | 76 - .../Encyclopedia/js/groupedItemsPage.ts | 163 - .../Encyclopedia/js/itemDetailPage.ts | 88 - .../encyclopedia/Encyclopedia/js/navigator.ts | 194 - win8.1/encyclopedia/Encyclopedia/js/topic.ts | 180 - .../Encyclopedia/js/typings/winjs.d.ts | 208 - .../Encyclopedia/js/typings/winrt.d.ts | 14644 ---------------- win8.1/encyclopedia/Encyclopedia/js/win.ts | 4 - .../Encyclopedia/package.appxmanifest | 37 - 30 files changed, 17022 deletions(-) delete mode 100644 win8.1/README.md delete mode 100644 win8.1/encyclopedia/Encyclopedia.sln delete mode 100644 win8.1/encyclopedia/Encyclopedia/Encyclopedia.jsproj delete mode 100644 win8.1/encyclopedia/Encyclopedia/css/default.css delete mode 100644 win8.1/encyclopedia/Encyclopedia/css/groupDetailPage.css delete mode 100644 win8.1/encyclopedia/Encyclopedia/css/groupedItemsPage.css delete mode 100644 win8.1/encyclopedia/Encyclopedia/css/itemDetailPage.css delete mode 100644 win8.1/encyclopedia/Encyclopedia/css/wikipedia.css delete mode 100644 win8.1/encyclopedia/Encyclopedia/default.html delete mode 100644 win8.1/encyclopedia/Encyclopedia/html/groupDetailPage.html delete mode 100644 win8.1/encyclopedia/Encyclopedia/html/groupedItemsPage.html delete mode 100644 win8.1/encyclopedia/Encyclopedia/html/itemDetailPage.html delete mode 100644 win8.1/encyclopedia/Encyclopedia/images/ep-badge.bmp delete mode 100644 win8.1/encyclopedia/Encyclopedia/images/ep-badge.png delete mode 100644 win8.1/encyclopedia/Encyclopedia/images/ep-logo-small.png delete mode 100644 win8.1/encyclopedia/Encyclopedia/images/ep-logo.png delete mode 100644 win8.1/encyclopedia/Encyclopedia/images/ep-splashscreen.png delete mode 100644 win8.1/encyclopedia/Encyclopedia/images/ep-storelogo.png delete mode 100644 win8.1/encyclopedia/Encyclopedia/images/ep-widetile.png delete mode 100644 win8.1/encyclopedia/Encyclopedia/js/data.ts delete mode 100644 win8.1/encyclopedia/Encyclopedia/js/default.ts delete mode 100644 win8.1/encyclopedia/Encyclopedia/js/groupDetailPage.ts delete mode 100644 win8.1/encyclopedia/Encyclopedia/js/groupedItemsPage.ts delete mode 100644 win8.1/encyclopedia/Encyclopedia/js/itemDetailPage.ts delete mode 100644 win8.1/encyclopedia/Encyclopedia/js/navigator.ts delete mode 100644 win8.1/encyclopedia/Encyclopedia/js/topic.ts delete mode 100644 win8.1/encyclopedia/Encyclopedia/js/typings/winjs.d.ts delete mode 100644 win8.1/encyclopedia/Encyclopedia/js/typings/winrt.d.ts delete mode 100644 win8.1/encyclopedia/Encyclopedia/js/win.ts delete mode 100644 win8.1/encyclopedia/Encyclopedia/package.appxmanifest diff --git a/win8.1/README.md b/win8.1/README.md deleted file mode 100644 index 0e7c5ab..0000000 --- a/win8.1/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# TypeScript Sample: Windows 8.1 Windows store app - -## Overview - -The encyclopedia includes a complete sample app for a Windows 8.1 app -built using TypeScript. The following features of TypeScript are highlighted: -- VS project integration: TypeScript compilation integrated into VS build -- Typing WinJS and WinRT: Early work on typing these libraries -- Mostly JS in TypeScript: Code is mostly the original JS, with a little - TypeScript - -## Running -``` -Open encyclopedia\Encyclopedia.sln in Visual Studio 2013 -F5 -``` diff --git a/win8.1/encyclopedia/Encyclopedia.sln b/win8.1/encyclopedia/Encyclopedia.sln deleted file mode 100644 index 7e55419..0000000 --- a/win8.1/encyclopedia/Encyclopedia.sln +++ /dev/null @@ -1,46 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "Encyclopedia", "Encyclopedia\Encyclopedia.jsproj", "{CB97C74A-DB4A-42FA-8B3B-FFED5198621B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Debug|ARM.ActiveCfg = Debug|ARM - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Debug|ARM.Build.0 = Debug|ARM - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Debug|ARM.Deploy.0 = Debug|ARM - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Debug|x64.ActiveCfg = Debug|x64 - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Debug|x64.Build.0 = Debug|x64 - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Debug|x64.Deploy.0 = Debug|x64 - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Debug|x86.ActiveCfg = Debug|x86 - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Debug|x86.Build.0 = Debug|x86 - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Debug|x86.Deploy.0 = Debug|x86 - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Release|Any CPU.Build.0 = Release|Any CPU - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Release|Any CPU.Deploy.0 = Release|Any CPU - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Release|ARM.ActiveCfg = Release|ARM - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Release|ARM.Build.0 = Release|ARM - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Release|ARM.Deploy.0 = Release|ARM - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Release|x64.ActiveCfg = Release|x64 - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Release|x64.Build.0 = Release|x64 - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Release|x64.Deploy.0 = Release|x64 - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Release|x86.ActiveCfg = Release|x86 - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Release|x86.Build.0 = Release|x86 - {CB97C74A-DB4A-42FA-8B3B-FFED5198621B}.Release|x86.Deploy.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/win8.1/encyclopedia/Encyclopedia/Encyclopedia.jsproj b/win8.1/encyclopedia/Encyclopedia/Encyclopedia.jsproj deleted file mode 100644 index 3b14a4e..0000000 --- a/win8.1/encyclopedia/Encyclopedia/Encyclopedia.jsproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - - Debug - AnyCPU - - - Debug - ARM - - - Debug - x64 - - - Debug - x86 - - - Release - AnyCPU - - - Release - ARM - - - Release - x64 - - - Release - x86 - - - - {cb97c74a-db4a-42fa-8b3b-ffed5198621b} - - - - - - Windows - 8.1 - en-US - 12.0 - 12.0 - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - groupDetailPage.ts - - - default.ts - - - navigator.ts - - - data.ts - - - itemDetailPage.ts - - - groupedItemsPage.ts - - - topic.ts - - - - - - - - - ES5 - true - true - - - ES5 - false - false - - - \ No newline at end of file diff --git a/win8.1/encyclopedia/Encyclopedia/css/default.css b/win8.1/encyclopedia/Encyclopedia/css/default.css deleted file mode 100644 index 9add9c9..0000000 --- a/win8.1/encyclopedia/Encyclopedia/css/default.css +++ /dev/null @@ -1,181 +0,0 @@ -html { - cursor: default; -} - -#contenthost { - height: 100%; - width: 100%; -} - -.fragment { - /* Define a grid with rows for a banner and a body */ - -ms-grid-columns: 1fr; - -ms-grid-rows: 128px 1fr 0px; - display: -ms-grid; - height: 100%; - width: 100%; -} - - .fragment header[role=banner] { - /* Define a grid with columns for the back button and page title. */ - -ms-grid-columns: 120px 1fr; - -ms-grid-rows: 1fr; - display: -ms-grid; - } - - .fragment header[role=banner] .win-backbutton { - margin-left: 39px; - margin-top: 59px; - } - - .fragment header[role=banner] .titlearea { - -ms-grid-column: 2; - margin-top: 37px; - } - - .fragment header[role=banner] .titlearea .pagetitle { - width: calc(100% - 20px); - } - - .fragment section[role=main] { - -ms-grid-row: 2; - height: 100%; - width: 100%; - } - -@media screen and (-ms-view-state: snapped) { - .fragment header[role=banner] { - -ms-grid-columns: auto 1fr; - margin-left: 20px; - } - - .fragment header[role=banner] .win-backbutton { - margin: 0; - margin-right: 10px; - margin-top: 76px; - } - - .fragment header[role=banner] .win-backbutton:disabled { - display: none; - } - - .fragment header[role=banner] .titlearea { - -ms-grid-column: 2; - margin-left: 0; - margin-top: 68px; - } -} - -@media screen and (-ms-view-state: fullscreen-portrait) { - .fragment header[role=banner] { - -ms-grid-columns: 100px 1fr; - } - - .fragment header[role=banner] .win-backbutton { - margin-left: 29px; - } -} - - -/*html -{ - cursor: default; -} - -#contentHost -{ - height: 100%; - width: 100%; -} - -.fragment -{ - -ms-grid-columns: 1fr; - -ms-grid-rows: 133px 1fr 0px; - display: -ms-grid; - height: 100%; - width: 100%; -} - - .fragment header[role=banner] - { - -ms-grid-columns: 120px 1fr; - -ms-grid-rows: 1fr; - display: -ms-grid; - } - - .fragment header[role=banner] .win-backbutton - { - margin-left: 39px; - margin-top: 59px; - } - - .fragment header[role=banner] .titleArea - { - -ms-grid-column: 2; - margin-top: 44px; - } - - .fragment header[role=banner] .titleArea .win-type-xx-large - { - display: inline; - height: 60pt; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - width: calc(100% - 20px); - } - - .fragment section[role=main] - { - -ms-grid-row: 2; - height: 100%; - width: 100%; - } - -@media screen and (-ms-view-state: snapped) -{ - .fragment .win-type-x-large - { - font-size: 11pt; - line-height: 15pt; - } - - .fragment header[role=banner] - { - -ms-grid-columns: 60px 1fr; - -ms-grid-rows: 1fr; - display: -ms-grid; - } - - .fragment header[role=banner] .win-backbutton - { - margin-left: 20px; - margin-top: 75px; - } - - .fragment header[role=banner] .titleArea - { - margin-top: 71px; - max-width: 260px; - } - - .fragment header[role=banner] .titleArea .win-type-xx-large - { - font-size: 20pt; - line-height: 24pt; - } - } - -@media screen and (-ms-view-state: fullscreen-portrait) -{ - .fragment header[role=banner] - { - -ms-grid-columns: 100px 1fr; - } - - .fragment header[role=banner] .win-backbutton - { - margin-left: 29px; - } - }*/ diff --git a/win8.1/encyclopedia/Encyclopedia/css/groupDetailPage.css b/win8.1/encyclopedia/Encyclopedia/css/groupDetailPage.css deleted file mode 100644 index c1ac94c..0000000 --- a/win8.1/encyclopedia/Encyclopedia/css/groupDetailPage.css +++ /dev/null @@ -1,173 +0,0 @@ -.groupDetailPage .groupList -{ - height: 100%; - margin-bottom: 4px; - position: relative; - width: 100%; - z-index: 0; -} - - .groupDetailPage .groupList .win-groupheader - { - -ms-grid-columns: 1fr; - -ms-grid-rows: auto 11px auto 20px 1fr 36px; - display: -ms-grid; - font-family: "Segoe UI"; - font-size: 11pt; - height: 100%; - line-height: 15pt; - margin-left: 120px; - margin-right: 70px; - overflow: visible; - padding: 0; - width: 480px; - } - - .groupDetailPage .groupList .win-groupheader .win-type-x-large - { - -ms-grid-row: 1; - margin: 0; - max-height: 48pt; - overflow: hidden; - padding-bottom: 4px; - } - - .groupDetailPage .groupList .win-groupheader .image - { - -ms-grid-row: 3; - background-color: rgba(147, 149, 152, 1); - height: 238px; - margin: 0; - width: 480px; - } - - .groupDetailPage .groupList .win-groupheader .description - { - -ms-grid-row: 5; - column-fill: auto; - column-gap: 70px; - columns: 480px auto; - margin-bottom: 12px; - margin-top: -2px; - overflow: hidden; - } - - .groupDetailPage .groupList .win-groupheader .description p - { - margin-top: 0; - } - - .groupDetailPage .groupList .item - { - -ms-grid-columns: 110px 10px 1fr; - -ms-grid-rows: 1fr; - display: -ms-grid; - height: 100%; - width: 100%; - } - - .groupDetailPage .groupList .item .item-info - { - -ms-grid-column: 3; - } - - .groupDetailPage .groupList .item .item-info .item-title - { - margin-top: 4px; - max-height: 20px; - opacity: 0.8; - overflow: hidden; - } - - .groupDetailPage .groupList .item .item-info .item-subtitle - { - max-height: 20px; - opacity: 0.49; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - - .groupDetailPage .groupList .item .item-info .item-description - { - max-height: 60px; - opacity: 0.8; - overflow: hidden; - } - - .groupDetailPage .groupList .win-item - { - height: 110px; - margin-bottom: 10px; - margin-right: 60px; - padding: 10px; - width: 472px; - } - -.groupDetailPage header[role=banner] .menu -{ - background-color: #FFFFFF; -} - - .groupDetailPage header[role=banner] .menu .win-command - { - color: #2A2A2A; - font-size: 20pt; - line-height: 24pt; - margin-bottom: 13px; - margin-top: 6px; - padding-left: 20px; - padding-right: 20px; - } - -@media screen and (-ms-view-state: snapped) -{ - .groupDetailPage .groupList - { - width: calc(100% - 10px); - margin-left: 10px; - } - - .groupDetailPage .groupList .win-groupheader - { - visibility: hidden; - } - - .groupDetailPage .groupList .win-item - { - height: 64px; - margin: 0; - margin-right: 18px; - padding: 10px 0px 10px 10px; - width: 282px; - } - - .groupDetailPage .groupList .item - { - -ms-grid-columns: 60px 10px 1fr; - -ms-grid-rows: 1fr; - display: -ms-grid; - height: 100%; - width: 100%; - } - - .groupDetailPage .groupList .item .item-info .item-title - { - max-height: 30pt; - overflow: hidden; - text-overflow: ellipsis; - } - - .groupDetailPage .groupList .item .item-info .item-description - { - visibility: hidden; - } - } - -@media screen and (-ms-view-state: fullscreen-portrait) -{ - .groupDetailPage .groupList .win-groupheader - { - margin-left: 100px; - } -} diff --git a/win8.1/encyclopedia/Encyclopedia/css/groupedItemsPage.css b/win8.1/encyclopedia/Encyclopedia/css/groupedItemsPage.css deleted file mode 100644 index 9972b0a..0000000 --- a/win8.1/encyclopedia/Encyclopedia/css/groupedItemsPage.css +++ /dev/null @@ -1,140 +0,0 @@ -.wiki -{ - font-weight:300; - font-family: 'Segoe UI'; - color: black; -} -.bee -{ - font-weight:300; - font-family: 'Segoe UI'; - color: #ffdd33; -} - -/* This selector is used to prevent ui-dark/light.css from overwriting changes - to .win-surface. */ -.groupeditemspage .groupeditemslist .win-horizontal.win-viewport .win-surface { - margin-left: 45px; - margin-bottom: 60px; -} - -.groupeditemspage .groupeditemslist { - height: 100%; - position: relative; - width: 100%; - z-index: 0; -} - - .groupeditemspage .groupeditemslist .win-groupheader { - margin-top: 5px; - margin-left: 70px; - padding: 0; - } - - .groupeditemspage .groupeditemslist .win-groupheader .group-title { - margin-bottom: 10px; - margin-left: 5px; - margin-top: 0; - } - - .groupeditemspage .groupeditemslist .item { - -ms-grid-columns: 1fr; - -ms-grid-rows: 1fr 90px; - display: -ms-grid; - height: 250px; - width: 250px; - } - - .groupeditemspage .groupeditemslist .item .item-image { - -ms-grid-row-span: 2; - width: 100%; - height: 100%; - } - - .groupeditemspage .groupeditemslist .item .item-overlay { - -ms-grid-row: 2; - -ms-grid-rows: 1fr 21px; - display: -ms-grid; - padding: 6px 15px 2px 15px; - } - - .groupeditemspage .groupeditemslist .item .item-overlay .item-title { - -ms-grid-row: 1; - overflow: hidden; - width: 220px; - } - - .groupeditemspage .groupeditemslist .item .item-overlay .item-subtitle { - -ms-grid-row: 2; - width: 220px; - } - -@media screen and (-ms-view-state: fullscreen-landscape), screen and (-ms-view-state: fullscreen-portrait), screen and (-ms-view-state: filled) { - .groupeditemspage .groupeditemslist .item .item-overlay { - background: rgba(0,0,0,0.65); - } - - .groupeditemspage .groupeditemslist .item .item-overlay .item-title { - color: rgba(255,255,255,0.87); - } - - .groupeditemspage .groupeditemslist .item .item-overlay .item-subtitle { - color: rgba(255,255,255,0.6); - } -} - -@media screen and (-ms-view-state: snapped) { - - .groupeditemspage .groupeditemslist .win-vertical.win-viewport .win-surface { - margin-bottom: 30px; - margin-left: 6px; - } - - .groupeditemspage .groupeditemslist .win-vertical.win-viewport .win-container { - margin-right: 42px; - margin-bottom: 15px; - padding: 7px; - } - - .groupeditemspage .groupeditemslist .item { - -ms-grid-columns: 60px 1fr; - -ms-grid-rows: 1fr; - display: -ms-grid; - height: 60px; - width: 272px; - } - - .groupeditemspage .groupeditemslist .item .item-image { - -ms-grid-column: 1; - -ms-grid-row-span: 1; - height: 60px; - width: 60px; - } - - .groupeditemspage .groupeditemslist .item .item-overlay { - -ms-grid-column: 2; - -ms-grid-row: 1; - -ms-grid-row-align: stretch; - background: transparent; - display: inline-block; - margin-left: 10px; - padding: 0; - } - - .groupeditemspage .groupeditemslist .item .item-overlay .item-title { - margin-top: 4px; - max-height: 40px; - width: 202px; - } - - .groupeditemspage .groupeditemslist .item .item-overlay .item-subtitle { - opacity: 0.6; - width: 202px; - } -} - -@media screen and (-ms-view-state: fullscreen-portrait) { - .groupeditemspage .groupeditemslist .win-horizontal.win-viewport .win-surface { - margin-left: 25px; - } -} diff --git a/win8.1/encyclopedia/Encyclopedia/css/itemDetailPage.css b/win8.1/encyclopedia/Encyclopedia/css/itemDetailPage.css deleted file mode 100644 index 3975cbb..0000000 --- a/win8.1/encyclopedia/Encyclopedia/css/itemDetailPage.css +++ /dev/null @@ -1,103 +0,0 @@ -.itemDetailPage section[role=main] -{ - -ms-grid-row: 2; - display: block; - height: 100%; - overflow-x: auto; - position: relative; - width: 100%; - z-index: 0; -} - - .itemDetailPage section[role=main] article - { - column-fill: auto; - column-gap: 80px; - column-width: 480px; - height: calc(100% - 50px); - margin-left: 120px; - width: 480px; - } - - .itemDetailPage section[role=main] article header .win-type-x-large - { - margin-bottom: 20px; - margin-top: 0; - } - - .itemDetailPage section[role=main] article header .win-type-medium - { - margin-bottom: 20px; - margin-top: 0; - } - - .itemDetailPage section[role=main] article .image - { - height: 240px; - margin-bottom: 3px; - width: 460px; - } - - .itemDetailPage section[role=main] article p - { - margin-bottom: 20px; - margin-right: 20px; - vertical-align: baseline; - } - -.itemDetailPage header[role=banner] .menu -{ - background-color: #FFFFFF; -} - - .itemDetailPage header[role=banner] .menu .win-command - { - color: #2A2A2A; - font-size: 20pt; - line-height: 24pt; - margin-bottom: 13px; - margin-top: 6px; - padding-left: 20px; - padding-right: 20px; - } - -@media screen and (-ms-view-state: snapped) -{ - .itemDetailPage section[role=main] article - { - -ms-grid-columns: 300px 1fr; - -ms-grid-row: 2; - -ms-grid-rows: auto 60px; - display: -ms-grid; - height: 100%; - margin-left: 20px; - overflow-x: hidden; - overflow-y: auto; - width: 300px; - } - - .itemDetailPage section[role=main] article header .win-type-x-large - { - font-size: 11pt; - line-height: 15pt; - } - - .itemDetailPage section[role=main] article .image - { - height: 140px; - width: 280px; - } - - .itemDetailPage section[role=main] article .content - { - padding-bottom: 60px; - } - } - -@media screen and (-ms-view-state: fullscreen-portrait) -{ - .detailPage section[role=main] article - { - margin-left: 100px; - } -} diff --git a/win8.1/encyclopedia/Encyclopedia/css/wikipedia.css b/win8.1/encyclopedia/Encyclopedia/css/wikipedia.css deleted file mode 100644 index 4ff8097..0000000 --- a/win8.1/encyclopedia/Encyclopedia/css/wikipedia.css +++ /dev/null @@ -1,283 +0,0 @@ -/* -body -{ - word-wrap: break-word !important; - font-size:1.5em !important; -} - -h2 -{ - font-size: 1.5em; -} - -h3 -{ - font-size: 1.5em; -} -h4 -{ - font-size: 1.5em; -} - */ - -h2, h3, h4, h5, h6, h7 -{ - break-after: avoid; -} - -img.tex -{ - /*max-width: 380px !important;*/ -} - -a -{ - text-decoration:none !important; -} - -.firstHeading -{ - display:none !important; -} - -.noprint -{ - display:none !important; -} - -.printfooter -{ - display: none !important; -} - -.catlinks -{ - display: none !important; -} - -.metadata -{ - display: none !important; -} - -#footer -{ - display:none !important; -} - -#jump-to-nav -{ - display:none !important; -} - -.toc -{ - display:none !important; -} - -#siteSub { display:none !important; } -#contentSub { display: none !important; } - - -.dablink -{ - float:none !important; - width: 100%!important; - display:block !important; - background-color:rgb(230, 230, 230) !important; - margin: 2px 2px 2px 2px !important; - font-size: .6em !important; - font-style: italic !important; -} - -.infobox -{ - float:none !important; - width: 100% !important; - background-color: rgb(230, 230, 230) !important; - margin: 2px 2px 2px 2px !important; - border-style:solid !important; - border-width: 1px !important; - border-color: rgb(200,200,200) !important; - font-size: .75em !important; -} - -.infobox caption -{ - display:none; -} - -#coordinates -{ - display: block !important; - border-style:outset !important; - border-width: 2px !important; - border-color: rgb(200,200,200) !important; -} - -.floatnone -{ - float:none !important; -} - -.rellink -{ - font-size: .9em !important; - margin: 10px 10px 10px 10px !important; - font-style: italic !important; - background-color:rgb(230, 230, 230) !important; - break-inside: avoid; - break-before: avoid; -} - -.editsection -{ - display:none !important; -} - -.magnify -{ - display:none !important; -} - -.thumb -{ - display:block; - - margin-top: 0.5em; - margin-bottom: 0.8em; - border-width: 1px; - border-color: #cccccc !important; - break-inside:avoid !important; - text-align: center; - background-color: white; -} - -.tright -{ - width:40% !important; - float:right !important; - clear:both !important; - margin-top: 0.5em; - margin-left: 0.8em; - /*margin-right: 0px;*/ - margin-bottom: 0.8em; -} - -.tleft -{ - width:40% !important; - float:left !important; - clear:both !important; - margin-top: 0.5em; - margin-right: 0.4em; - /*margin-left: 0px;*/ - margin-bottom: 0.8em; -} - -.tnone -{ - margin-top: 0.5em; - margin-right: 0.4em; - margin-left: 0.4em; - margin-bottom: 0.8em; -} - -.thumbinner -{ - text-align: center; - overflow: hidden; - padding: 3px; - font-size: 94%; - border-width: 1px; - border-style: solid; - width: 90% !important; -} - -.thumbimage -{ - width:100% !important; - height:100% !important; -} - -.thumbcaption -{ - font-size:0.8em; -} - -.references-small -{ - font-size:0.5em; -} - -.wikitable -{ - float:none !important; - width: 400px !important; - max-width: 400px !important; - background-color: rgb(230, 230, 230) !important; - margin: 2px 2px 2px 2px !important; - font-size: .6em !important; -} - -.wikitable th -{ - background-color: rgb(220,220,220); - border-style: solid !important; - border-width: 1px !important; - border-color: rgb(200,200,200) !important; -} - -.wikitable td -{ - border-style: solid !important; - border-width: 1px !important; - border-color: rgb(200,200,200) !important; -} - -table.autocollapse tbody tr -{ - display:none !important; -} - -table.autocollapse tbody tr:first -{ - display: block !important; -} - -table.collapsed tr.collapsable { - display: none !important; -} - -.collapseButton { /* 'show'/'hide' buttons created dynamically by the */ - float: right; /* CollapsibleTables JavaScript in [[MediaWiki:Common.js]] */ - font-weight: normal; /* are styled here so they can be customised. */ - text-align: right; - width: auto; -} - -.NavFrame -{ - width: 100% !important; -} - -/*#ogg_player_1 -{ - width: 100% !important; -} - -a.image img -{ - width: 100% !important; -} - - -div.thumbinner div div button -{ - width: 100% !important; -}*/ - -.multicol -{ - font-size: .8em !important; -} diff --git a/win8.1/encyclopedia/Encyclopedia/default.html b/win8.1/encyclopedia/Encyclopedia/default.html deleted file mode 100644 index 6d513f1..0000000 --- a/win8.1/encyclopedia/Encyclopedia/default.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Encyclopedia - - - - - - - - - - - - - - - - - -
-
-
-
- - diff --git a/win8.1/encyclopedia/Encyclopedia/html/groupDetailPage.html b/win8.1/encyclopedia/Encyclopedia/html/groupDetailPage.html deleted file mode 100644 index 04dbf01..0000000 --- a/win8.1/encyclopedia/Encyclopedia/html/groupDetailPage.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - groupDetailPage - - - - - - - - - - - - - -
-

- -
-
-
-
- -
-
-
- -
-
-
- - -
-
- -
-

-
- -
-
-
-
-
- - diff --git a/win8.1/encyclopedia/Encyclopedia/html/groupedItemsPage.html b/win8.1/encyclopedia/Encyclopedia/html/groupedItemsPage.html deleted file mode 100644 index eefb420..0000000 --- a/win8.1/encyclopedia/Encyclopedia/html/groupedItemsPage.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - groupedItemsPage - - - - - - - - - - - - - -
-

-
-
-
- - -
-

-
-
-
- - -
-
- -

- Encyclopedia -

-
-
-
-
-
- - diff --git a/win8.1/encyclopedia/Encyclopedia/html/itemDetailPage.html b/win8.1/encyclopedia/Encyclopedia/html/itemDetailPage.html deleted file mode 100644 index 7ec4a70..0000000 --- a/win8.1/encyclopedia/Encyclopedia/html/itemDetailPage.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - itemDetailPage - - - - - - - - - - - - - - -
-
- -

- -

-
-
-
-
- -
-
-
-
-
- - diff --git a/win8.1/encyclopedia/Encyclopedia/images/ep-badge.bmp b/win8.1/encyclopedia/Encyclopedia/images/ep-badge.bmp deleted file mode 100644 index d180a9c799c30651a02f5ba1e76793a4d8b067b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 158 zcmZ?royPzHc0fu4h$Wzyk%18`kpLtQ^Fc6J080G-|DWN1<9~)f4E78^1mqb$&g^G+ zY;&C9SWPlR15oe0|CL}Y_uq!W=BEu-{*h9c&iJ HOpw_CNy02E diff --git a/win8.1/encyclopedia/Encyclopedia/images/ep-badge.png b/win8.1/encyclopedia/Encyclopedia/images/ep-badge.png deleted file mode 100644 index e5a2612d72e3e3640a6773fcd0c211b94fa8d1ff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaT3?y&uT)!Jgv7|ftIx;Y9?C1WI$O`1M1^9%x z0_p$%|1Z5c|1OZlS>O>_%)r2R2!t6$HM|;tf%#S zmdKI;Vst0QfCLK>z>% diff --git a/win8.1/encyclopedia/Encyclopedia/images/ep-logo-small.png b/win8.1/encyclopedia/Encyclopedia/images/ep-logo-small.png deleted file mode 100644 index 927483c8d0fa577d139fe76d36aba3da955e8259..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 491 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf0f0$FK~zXf?Up@D zLQxoipHr7hl3*c(kc5kC=;$78qC-wjtqp=xKf=EeEv~h-1?nI|kq|BpItUGZCHCRH zr*n>%Xek}yHguomzVCZJo^#F}&Jj|lgSVchjAQ-(P%^>kuW>f^7(v@>$+x)UWC5R^@(VNd{dL! zVC}=ssXAvD$-=a0#Pbzw9WE1n)T<~Ki?UX$dD%A%&b?qg)_Q^HU4}v-FZ&&Wr;l$0 hV&4eFzVYA0@B!}x2e#d>g9ZQq002ovPDHLkV1gDj*9QOq diff --git a/win8.1/encyclopedia/Encyclopedia/images/ep-logo.png b/win8.1/encyclopedia/Encyclopedia/images/ep-logo.png deleted file mode 100644 index d559db4fa113005d880e7b657aa7c360c5b45d1c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3540 zcmds4`#Tei7w6Sn-zZ)QMc+giP0A%RccE8Exie}+mdG%3E#-bol7uOW$|ZM`jY!OO za(Tx#-{sn-yhETJm)#jbAC9_=X{>?Np-NZIw~qB%E!ld)W+Jv@ep7B z8^VHz*^vL?{2}lo9IedwYKBj(9u`OZO|P5s@zrIEac=_-YmpFZHv}J_c=x}-p9d6| zKb&;W#=`VgB$P%L$#9yG6=E{l-5$wq$36sjiemor_mrCCabeTrmz~s4s;LCN|Cyk3 z#z{k`yZj%ERN(~Yb55fC@a~tYx<}+3-U5^blf!+J!jt??++Cg?V}RLM6x--7jB~c^ zz&jL2EsCBk1~c|&-RN)pPx5>EUThJ(fNn8@QDv5wI+ZB zfcpPzE7AWI@ZcSevs@UqxpKpUKK@Y(!u%@G%!T>b#b3SEuJ+wN8) z+BV7~P3KEr6BMKVq$zeUB8q`ydsatD810<#il#NyICq3IW{TT6%kmy{;%CJm3g*Yl z_`k#<-{#z8UW~aP^WuO!8sGL8n?Nlu*ob0ZN=P;BG(jRd&$)h_i9d)H@u((~n&8vG zwT=hVUz~W*QyRowr5xk2S4AFAf*2u0{IzCfvfm!>Hu7iJ?W`@SyK-UFU`GKLn5+w? zE3xust)TcRYYE8ah+E;HqfWuavakk09G~OK`2&C7BWawVGa-|%DnQRgq_ER;C*{Q|#c6FH% zLmzNiW()aCtY}BNd*HH5kruCDzbCuop=Q&wjiuf7`Zv&N2Un|hMQZdgHF~l)&yncf zkgok#-0o^cL|5VDyLR6`$u)8dDE#+iPEGr6;M$KeAx)3wLEPE3Hb#5d$D0+SIz&%% z8mX!5S54b6o%5~ydZF%*vTP%{*0{Cq-JSJ?%K;;A`WG1Odo^H5S8U|POa;hm_vZUH z#b9Ll1+Om-8_Pqh!(c|3|9F;wP40R7=JdSgATlZX1$=XDA{`yWvQbx85A_$c?Q_;{ z%?0YIPnnemC>1a&j?vmOu>vrZaoS*xF+QJ+Q@0@v)^#vBxp=Z(2A0y6vMsKh%RcE% zHKtdoB3O#P;&w~FSe(%PedIA|jT+Xj$XxX0UMQlPLeCG~m*$~5l!Fh1XRdBQGL#zp zg6pS^b?tMi?p@5J$#sv_$bx%LW2@NXr+*`;t&T7>3 z#Ejq!YNNK+@DEpSSh%?r6kNXNxab-QA1lv<*pH9Hf+lM_8-r(!Sfugl_yeAbo*ogG zARVhvaB?r%doh+_?XgscJx@vhV{~kXL%4;ixgTfey&w}5;V(1~h+l%m5)6pwj%bH^ zGzpeC+yL<~TOD4hdoeVN0NeABm|TK$g#x_)g_@y4bPg>GyhC=#%mcbe#s`EEAZ&-R z^6Or}8OIr8$w+g(S<2xUCPn&5t#F|N*& z-1Ds$l+sBt08o|OK=aBjz z5aauU^hLcj!g>E^{%Jvb9Id0#>lFBjf^9K;Bl@~ZbzTsg3$sZ4!Pe~pXp~;amcN>D za&FjYk82dWi&5(NO==qGzEjr^GyJnvsmE}Cb1a7lVN(!v>oW@3@(RoMQFKac4x(ds z4M@J=-W2FG)gHF$NDTZlo?o5Z(9kfnO(Rd|m_VUupwleukjT~bUd=5tQ3Iz%LROS| zjdxedewtj%_KVKlS^ar(!@fHG6nmpwh~{V5GC0QuJ*;8|H+${G0oeLw&wJB!1%^?9s8Gp0Mxcp$D)$-Jokj7`YgD*;w!H6f&PWs7W&YR~x%eLx zJ@2RlBJ}U9Rc(J1k3;p+{QCIa2~GFOdQbDH{-;6Ygy5YVC99Rmi@fdHq@(hZ5;o1) zLm9$T<}>wXYB#W23NxM`qqJRYF>^`szs={gR)@ZIK|EgFTh}@;o2u!lPd@%086r*R zzjh%1dw|z_kV&rBVwr4g8nmG-OV;5DGp?_mU+?6N%eBd<{F87eGZ>-M4qeWp{Nhq3 zhE1b9Sfj6n5Nf=sD1M*;>O$I#LVGV$2My4t>>cV1QZjD9Q{uZ&# z(QyYUwZ~>4->ZT)LR~~BK{i*dTwpwrwuK8lbSdn&4kZJwZ78_m+vzzN_bq8-Kmv1O zIcXrp^(An;SdHv2BMMcBf4D=9>RmowybBhJ&j%~{BrmCttGUX`$~Nl>2Nx6+&;w|r zqobZ`9~&FT^ZrQvI$^O46Df&drA{C6q%s23HK%bQYZ$l|y1&sWcEm;Wa=@{upRQt3 z_DTOl9`#b2@|egXY^5tfT4e@8-k&2_FzR#-e?EM3#a6jE_G(Bz{FbKh-fUfcBW_@@x7)VHqq zJ4%Mwv~I1Uknhq?#yDMRD^E3_{tf-SXwOW)usSfP3E3JbfNb%;g=<<$ba1~U?gv9^ zd$*+Z@?m2T?+w(a2H7VzZB=@5x5U%&a2~L<=Ub|F8)=(#xP|(_z1?4*2_(naam0TJ zk9x9B{|f9xlrqz9;J3a##`pJ^_A16xCQ{H*YicfM<+OZEe3$eC$5mZK2Vd)?>jp3D zX`BnkRP}eKN_nLQP=|{*50xDAI>sjnin4Tu*-X^vibdj=XDlZ}SZV5p8Ijj}Cvi6E z!+YGa4KFoIH)eaJLj2RrT~a-B9<^A)YpGn{vOCCaV|*%!cB+gi0ct^=9HZbax3vkC zPYeL*F7Sx?!Y_%liyIeVJsH+|M*hR6wXWt1Rsm4<@{ZEU+lmChG-a|ad+EMBIo|AGKZF-kM<9_*J_zp6_Z`AU3L~MU(Bz@z~;#Ym%RQ&vYB-ErT+$wPU z$aCqy(g6bM3SGnJFQ2=wBJ@15&?VeXQggd2rdV&Yir z^?55i821{RJAeoBik?W~kl8M;%5B2d7dX9~@Z`w2Zir7**qlRURUAcZJ3_jZ%Ha5e zS|Dy~gpYP4Mgh>}dET@8qlodwzM`wV?wqLhn2~&MG}rIkIqeMPtl3y3llB)Rdb<&l z95b>WStKeZ78HDzc-k70L4!X#G4w#?r!2K z%ZJyHbDo?3^bVT3n4Cn70Ier~&7CbtQ4CWxR2 diff --git a/win8.1/encyclopedia/Encyclopedia/images/ep-splashscreen.png b/win8.1/encyclopedia/Encyclopedia/images/ep-splashscreen.png deleted file mode 100644 index 53bb89acfd3c2db5670a0f7d76283724cd612259..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14965 zcmeIZWm{WO(>7dhfdWB`(?BT_f)pvPfg(kM2Q6;Jr37t};847H3B>~xcW8^dyA=s8 z#fv|?*Y(`bFL;ml)BOQBlCXDX&zd!J&N=4_RaJh2k4uGn=gu8`c{!Ncojdp5-??*_ z{mDJxor5DbFj>upB8rlY#8zf0j3NE{_pSq^}zqX9{B#8hv#V4p=G|(denl)$ooLX)3YA) z2xReSef**9G@LV64{rE zxT$D#rf;{Y0K)(K@8X(;t*Nq=%(2Elzwn;Gt)53DT_<&(EaAXkw)00Yw;%ein~US+sHIc0JQCk&_T43)uNW3WPp|B_iXDv;Rgo z8Fdd!!Kt9+U3%@w23qe&{6XlTprA1$SArzvbRoCxiQUZGt2}SyM=q%lDMq3l5Z@R0 z-za11wbzo-q_{I;r#H9aUdv2mSGCKC1*M9w^9w> z8*fSsjH!Il>nA^9H{#DvjGw1ftUK>>Hh+k{`|Al9Hxl+;y3!;whF{T}Y)fliyA1yo zfoK<^4zu72hTUbC`0uwv7YEdH!}f*e3oqGtE&35Zi;m1sa`C{p@9s*GQiXnvhMoNx zqtuc`2b^bJ3P2LZQ#k@zK0f^S*#5L=O;+|JE&FiS(!HvXec0nNf6a3HI25p$cmDhR z@q!WlNws$Gn!Kca5(2F*Z)dj~N;Z>VXx{ zqgwTi7TGJ+MDFNketotCz3nN%j=@&p&^a>2WY4?Ws)BeAM9cL~LQ3k_Qfu&$D^@5WA)!0z@e{`X zT#7%eyZm53Mx0k=iC{P+Mui-zJ{vt(#fC~j2-@)NA7@VQ0e@>DJLE!-LeDB|t zPlmbv?Y)mcEZhTAy?g@K3=IuU<+syqaNnhNXe_hnPazb)avaPMJ^X;*w&ZwqbGg3= z#KbcrZ%KTwgZ5{OzL&d^)USO{#?7Rtftvrl$8Oc6q2Kih z5UD<=)0T_gNBFy<4f8XtXVK{(B}K*TU3Br^zbnz3Jm+hv4!#$gd3rVW*Sj@~1oZa2 zXB1ok6@@PhPema&uQ_kx6YR~&E|G4ZuH5b$_YJV!e${dsE>!W@oNRPX^7xtypa0ki z!w5xd?&NfQUykP7jKC8+E3K|goCzVT}J-I?Kg%xR9l z#%0nVeQ zrJc`Fd^X8ZIIqZ2VgPGF8^C(oIyy@9>zpS`44lcD`QC+SX={&O*1r4cfA{_))!xl( zx7m_dxF*+q_pDSQp-P0yi@4XQf0V;A z)bh_aClRNJ7>ZsJQ~ZPAvSsFO%koNy$Ish?6dDBc7~5HezqU??k_a+3#O)Rzt*LmY)Pd7Y`L!d1r5GI*A) zN>^A;KSaH2fu-t0ysBVNm90HiRWQkf@wQ&me_`F0xN z{+8o~n(giF&N*~cFJML*C-b8^!bEtWOQ@Q8& zvJ{0LxKQPnA#krt4yEG!I*N@JPfBS;k)R`5LDkaP&tZ^#InUk;5u z5ppeMN|{9+T``+OlM2l;+!}a@^$qAwJ~Fmz6je1L=cQVR%>!-a6S-2>McV`Bp=#Q_ zam-Z9LHc^D?_;eJ-grfkPk(3Bls&BM)oFKdj+BHqN1A+`U?*U-(Zeo8%&5)Mts5$3 z^sxrE=}HlyXWK$lz3=Gb9~mq^KD@FtgYuxO_?R$%M7dW=C~WHqsPv1_;sUQ17wH@m zE-pWb@yM?rmKsWuo)qL#qInn4bVkkJlBX*yCs9^5Hd{dOaQbBh)fWQ6Ry#rdoXSU5 zR`yZO{bILvGVQJ^7yFu7EZ{HK5&4G?g%(B4%+32V#f?hZ`^=LJEGP=k?6kGCIE0TYiK z^>T8zcqToa!|68xo!ai6tY{Zk_wZKa+DSyLz`JE=!CdPor|_#bC-+hE6xVOH{BdD+ z0=-@ew~m`n%1}GzBH+RSNmOU}1sj@M1Knmlc=fEkP>PEf%c|Z^=b{&2S%$xSKG>~$ zBlv16>oIZ!F(92h^V`)vd{$^YJbzEy z9xI_)|L@JwJe5|Im6VheP^PeKQrSSB=5F*#AFxn zAY>$NYd5anJ-mI>RNX~=eLBW!Vro5#s;GqM+!;OP(&|>@6nix=YL{U36ua?4t2|VD z$L0Z8_aZVzNNK>Fvs&nPO?GvNfn@f`lI)gDqmW{={*&i0nUIl}FJ8XPaGO9JzPa1* z+aK@n@X*Yb-C2O96@?!M!R4<3i8}uNcomeA%wyS;qU8;gmh$H0GSkir!35oB=5{~{ zFt7S*GX=W-9YAP?9U4WxE)LolMJsHQCwkQLl--Ml9HfB~#e!#7(u>R9zOY(b^k6ud z)Oy@z(LP>XNjWz;UVcMKkm!iwk?cP$wk8r556gMGB9rN;7kKF)iq~W!joO$@lZqFk zv$uVsMYP|`HA9UN(n!KE!ftu}Zmz^{{(n)iOTdiVFwfXk{Ypv-r7cjwZ^<$!kQ>Rf^eXjhH=x3Z(fV)519)yzt# ze{JJ|K_C$9K53=RxXmzHraU(VC|E7!<;egTNy)fx)Z|&EFJuN(oJ}(G^zXLw^(SFu z5HsPo2#U~=cOgOtsxQcky#*AL2OtRpS0o2?t72W&j=5rw$WpoVY3`~vhOXSfjt<8k z_@y!I?Q3XMCUz1&={Hof`@>C-u7nV$CfVhDMSaF1Z^Wn9*o;3U2OkVM|g`T3Z0AqBv?n+Eh^ zyFz2ZL(8CTSs6Z)xuAIG@_RK+DwvI+h2_=bVS7ub>y1)&YhuObFFAwjl#}Jh)9eRt zou)Oe3I@OL6K8tdxT(l+xtgj#i{(7$CKAOn|@|Wi#jvrCi>>!C)V^)AcQg!G?{w6 z5Z<2Nv!c8f-*!Nh!YmVA49dZeaHea6eUDev*;~QvFlUaw93w6J+L$s2i#eT|={;gQ90$WanA5=rJC(&J<@NPW|4Zt+!t~*{srchI|IB z?H?gR;sRqLWWh4qwTql}R{IswXW@^EDwFSJ2qA(O6%%m{$!1M5vf=E=Sj=+xysTtC z>2Arg2(Gac5xZAeZ9q=$)X6ll(b){o)Y7EKp@tL8$)^~dX3LhXkskxch@w4XGF4&Hpaio!l=Z!P_uVKN9AX9b4 z)(cZG%o-{5qNh=Q?!o)(5qhU^yB@5`*Uj7KZv!_98XcR~?Bv9r!=iO7tztGqmw}E) zpQ9KhD|q9unbnlX-Tr*{0m6v#WQ_;FkmA0LS6)7Re0*Cq1|t&8;GahOzhh%!vT7Sl zOic-C1fCZmk2bQSdt?&Q9e?2%`J5zRN+ZgH(PM*ikw5VP41WfE1T}2b(c(AVWEb5W z%DTU6iI{#C397|M>o?qTH6oovX9T+KvZ(bs%Uq_r~c}DR&hS*z}5L{bh z=B^G1eZQme(@;0LdP&LJLC;)^0CZ zb#H1GdGmOnoSYv7Xbw5){Hf7EZY|T-=y#hmV74t3^!W1?Q-C6PZl+{}L0SFc%6OHY zaLrPbY8=I$;TC?>SkhT25>BCWY$-$E(?j=#F)q(2>)6gppZ?$@^yHGBV1B#L;&vs2 zg?luMGiW~q9-~KAD$}U&R53kE$P*pOa`QTTJKLLm>ofR2IfUl@PkeY?S_;sS_t^AoOl@>fJH(%m z9d8V`t|A>1r8FWkl}Xe&x_T6Jx|2k#%hgnrf@Hnwq7SL|ZaGjPr@TSPj`~zSC68~=zafY?J+@fWg{rS zwkQcVw-dqjG)ANDx0zx-SBqBhsi{R%KA8Y7;!DS%wDJq!O$|5-znXSNCE5>Gv4w!^ zeXl)%=gjoIke{eT=jY2!XiIqQ*R5Zj`T$SqZHc5Vf;UUGg=(%JvEzOO@7W&dzL!Q! z*coz?5nYOU)is*57boh4(*M8}|ISN6?9#;)#T~u=_onff8qtX#NvcFG8hsDWO;!i%c)ORp6Mb<;aL1;e!WZ}D6mgo8}`rR7%EVyhX zTzUJ{dK{Q2R`gxck3HHeDs7G}HOmDG#(v{b6lSg8q2)UF)uuPVc_l*iUT%9-eAqWs zbfFrR6aA)c@{k(_O&|F>7>coonYY&#=VwSV^en(^CU}OZ{df^+9&D6EmJoWa`KQn$ zHbt%D>9fJXaxY=G{jQ}=?bOWP9J{O+6CMH)Pv8{-S?t}y7c8mSJ=H>-*_zW5>pP%{ zbpcXKb{8!++Hl@aAh*?n!zPgx&x17W(I%?Jq~Tvb13=g6w>Q^N(Z&c*rW5=0UmYqT zx+zvSzwkKY$E7-!9P^n2Z&THpuMQRK(u|~0PtSoRHm7wEyZO5UkPp2%{Xo2}gmX53 z=96X&0SmcqsMe+VKc@SG3=J#5r{?dfVhITe`8?iO4nnsgJ7~1(jI=7hx$>ygNfcD% zezMp)Z*;D~=sbp8Cg&+X!>iSFg5b1zTzHo_!b=+BUDBY(v*xo5$WygCZ`x(X%i29BPSTKxT^Om zi)6oaB|YH|!^_uC;6%#2wefu8X#k`tFZTz~zO+_RX?gj-YT^ujxahsI(y01}0+l89 zSO};$HgsX(;o2qotVu_<7ss1G%^noLZPeGe8@c<6hsV5s=!r>4PtX|4LjFoZzeSua ze5lk&+>cpgOgg?p0->lAIe@t9lqr27l2iJ$T>_ezEuOc!L#Mhjz^SVt(1+ zBHTXNa6et2kF2D>3f|z#;8v;5D><$kxa1Z|`~a!+4SN9LIhZhweip}7TRd7p69?Xk zcqblO3|&@MmiwUs z=oBC&wG2?G(u9UfH&aqq53V=U@j$w8gX<>4GqvYMK{}F>pS(qR0BCaw;1Bbvi~LEk z-OABb=jLIq>w>(-^c^8|eZ6OU7@4#6!?Q)d77XR9pSW-#P&{5i%y?ydd_1t=8`Bl* z0AKpt)>G{%d^la^NaRSdwyCIleYu_@$ctq&$g1p>12YeS=*D}Ll)9a?Os4|Uw4lpD z@A`D6^6dz0I-_2{;%_~42cZwv^>tl-W?L8=Z-Et^kc#g}sf!NjTpw1>?IJ}Aj@8wq zd$m@u7zXO=S*0`GIvKXn(EOMC9rfbAZ^;Tkj82>UMhZjKKOdxH4dXifAY&2+#(xI=kw>cB%(95v9a-AeaY#sbXfG=ovA9f z=z0KwZGsdyzI`O9Hsgb0vDlcH7-s{Ejj0eZfZ1Ul2SqM*TOKehZXc9ha1EXZZ^0g* zRgU=&98QUk8uks^i`BI_b0K*p;^#ELL&le|p_9ITrTtl0oN43k^z9%JzGm(7K9B`} z53wZ7Zk^VpT*x72adO5_R--)(aeW7`uOkZH`0?q!QeHG+S`H{()XQBKmC)On&Qo1v z1X_i_GCh`YPOLjwH_fYtW&tGbt;zGR?RMMB$6&kxRvAm|Yv9t)2ShOr4$fAw+?a26uxBi%86-JRd9@c{ttp_dcSxaO+-1#oLp6 z2E)wt!7Mz5?dC5{bakV#tq9mc8tbgaB)#Z-(y>b=hP4pusQaV<G${RZSlZDLC^dcY!RC3eJ)x$IKzWx?YfwFOZ}qbCQ~`Q-TVj9 z_xrc>osxoPV-3T2VCw8*d`%ogXiM4^Fi=|&6X_xus0`hTbz9QF{4iM}v|=JVoPOXU zQNI9Y?zFuN&(9I-&CM{hREx5C#L1pcDXGyH!~1$WWk^&Ot9>O16Qg38JiB+ z##+p$XwcD39f1%u?;)+@-~qrt5*QJfDXC0I9h)M0*|>@EcU(Cj!WL4z3j76$jOu9v zZh9k%PAIFH@$y8Jsqc%P!dS$``}LqIi%gc9W%raCdndh-isvv*-X;+KD#2s?t$pkF z?=hGaSn|Pyo2^u)n#C%s=pR8*o{Uj+4Q`}KkJ|Hk&e=&AdB&uCE; zf{w|*_$Zdo2%iVJnH}u37d|8Bs|OW}uyEVorVi8$hEcI!7VHmPDyqQ$HO-OTL{n39{ObG&YkTPiumNLD zMEt_Sdf3e`z-|H@n2uRV%>m`O0W+1F|JnuZH@A9q*FX8ug);AFkka~e4a6r~UNqP4 zIpJ+bC^ZS^8l zukpEZ{Pap%(nD6**Nvb~k2)2Nz>Rz3c;ROBv|-CM&^jVUc+l)?129$B2ehWVf>HBG zQJ^?%Ga%l#?woqn)Aqe|GE{fYUH^)x^eW&`t)yLPVPzoZwG=M}l}yNj%b=*;Ol1sS z^5#@oHemDEk*thNchcE*a&syxHA>_pfz9=gj6{sa*@SfbS;c8|OvjjOPS+^J;lt%aEV|>6L6;AB zmnBVk-)4!WcpBHR*~_?&4!=PO5dGx1-`;n}UZaJCOpjSj@)_hdv-Wn}E0a2=R1{0(2Oft+&0lNL8Eg32 z45vTj4DAl@xbH`>8U9U_bE?`yEt%#TOa4k4X5O54lOK(p>nG`d`8Ch~ zKjCr=kZxti0((FeG@5vt)EZ3KJ9%0JfCzw#dkLkdr&rl8y()0nB5eN_otVRnR7&OV zx2Wju$s)plm;nCgb1&=H=t_)*0oT5~=2Q6A-Id@!bC+gNNZU=1pVo;diQbFen}*t_ zA_>}--8M^-l%~yu=?Ah1JsV?-{cM{sWc7@l)G?c}Si0U-^0_Cm zY&pOR#UwDlGN0!-`!ZWNhbyHall=tlyd28h6GZw&oJ(+O$GxG)v`e?jrpj?iO4raF zjc)e2^gRp>D(%rKHH6x-eT`{qnRfRF1E|jP*s3n=9@TQM4Y{VawvpSorZdz+x5i#6 z(+)8T83*OqyRr=Ge>?a~WT8SNEj{Yct1sg^F?dMj5NG|Yn2d+)3xOqxELYDZ+jT)G z-}iXDc8Zx|rVN?1L7Jb=SE6fO%x~(a+;fJ#r=)prk?RSSH-lIL%Yr05FQZqbJboE0 zWI)>OAV#a_DJS3+OgH;90OV?z1>8;QXSCTJkvg(fa++ho1#HEq%`Jrt*>o#hGm_OqAziq68@lA zOf?6<<bTtVBtOvTgRc9MRB$f;@8n&L{ zr97cMl&3-;7tEa>oG*|q{AHc}tnPY&V*H`V$lehp2O3bQ{F0A7V%n)l@fRmT{E@w@}0u; z6|+aAjn4OF&i1!)Y<9Nyz&0086Myg}{v+=t@|4p7n+8PB^bv?~W1Y*5p~L-_+h%XO z#SJ^3qyE=Q!4dIQ8KVy_wBhhFvu+-3D zbYl3(;**k!R8r*XT{jO;XDud2b#dWryuald(h_bNiZ0s~npfp{zo^oPNAg;6X;&I* zoubH^OT8@wP)reKlAc;TMXy@kc7Kml71jFs?(15PVNYA6aPCvBE5Qoh7{gj=-bl;& zZ$MKO5rLFV81xHuqhz{WW3_SMP3WLQ9}~I(Tse>{bM_cPq^4ujv_h-bRYIO>45W%d zOzZ|7&Jk-{W^#UrB@F{IfEACC@42~<{su5F-kTT8oTi=w_4oHDgtKM04q@1j#8M_O z&UDQsU0rgBX~H6~LOXv*jy}U4;&|4fZ29)jYJr0KbzRtYp>DJ=Y}+J?Cc~*}gwlWw zr!^UhO1RA*ZcxKVgrX3XlLxLxbr(9P;$zL^ZsapdIITKc>{^Vn&kd zfaC+K%WgASLQCtsyV$b0)FB zssRSVar{54=$0=k0NoQdL3`D?2WXhT9vhU)hNxxH@fh>=dPR+gT!t1Tlt@9zw=n~z zb+rhPu3~RL*m3K!5glFUe%6dF9>O!uEdk-5(7C?MD zf`f<>_kAT^MWMI^U&xuWkMm&C?F)-p(26crG!#@U!!4iQ@E+z934sA(7rV%xRtAi+ z5jwSw;GFjRgd*Rau|28w^_zu7C5I{fo?r!I@1GB!b!l$YpU&7~w=lik-N3jnN{^BO-sSGR%JPl-q{4mBw1+8h6~G zH-E?koetj_QqU@k(@b(~HKyQ0f$6AxzKuD;DO}7dVwJ9je9&6@;zUoERo~^Sg{aA= zU|bLW3@)KiO3xo|zY2nVfU}X>%I*tVMs?9#Y+YM$#QGfXW#(=k4l6bd>MEORo7I@i2|x zq18v~$v4McCXg+RJ`{!nxzW+ketVWJGbgfT{#q9|ww|dGtdN!z%_?Hpq1omn{h&f- zmjiMWpaFz5ab!{ek1h}7zDTcCT}&#M zvHv=bW>JRsp?qDvDz0Bh?3XVT2g&~I@0X|Dx?>!TnBOWKM^(g!7K@@F6?P-)fy~t(wf&h;GW)^gG$7}@3Z`k zB2`9f6kruV%oynwlqnS_ylrbjF%} zyr|xHlRf+>X8n53F+ktCi&rjWX7}{pY()#N6wttQ$pWKJxOVi~#OOmqVl*Y+*Nywr zbbQO@xnqiH*$eM#IxAR$S&TIcOkg=<`Jmmm*+oMA{Xvne5rQ;Ah)dx3$ z5U0)Vo$A&2gNn!7q~g8*{Cu3XCtoEUKZNS4(&07h`fSkP?{XyZ+bAl<<}--N+S*!c ze-&qL+AI)B;WEko}_bz1ONp8j1KF**?2 z^n!u;i&v<-FRzMV5>}LH;JE&Jq9RZfSmATRs-b1=Ut+j+oOTv_0n6UfE*@cuAigFL z6F{z)^c)FPJtRgmF)^_b&YhC}Ug4S#6naC=2J8NG|M4$Je)L4$dWJ3X9{UMMiKhJ( z`S(7(bmql-gHT))MJs;;JWqJ@t}NnOLg&e~T5Wuk;suIpN0pThtccx&F5r-Y{* zB}6hNCp0Q>B~*GPW4+e$2xmA&A;YC+O8c%oA8irS(`PQ88ta0kJZb_~(!lnJ1uNtq z0F6~*LI4!-N$P8dM2K4M&9SN*={nG9TaOnect?J<`2k`As?$u3NP+Eab@3YW&tG!9 zsP&c~Y`%Q4gWUIMZbPGD4S7?rb4)LfMwy%|kM$T&h}UOK?%BjSJj_tMlzwcn7ojD1@>yo{Op`fbV0u)PD z#&N772X{KNTr0rba~Mf0`ug5T1O=y$yUkeV<>Yx~et}BZPGAI2#?-OB4+guLGaCVx z_neAOiWbdrd>3!NU>?x)ZYi}wba037Ijyilu2Y!O8Ep{*P+h|DFbkZ#gT_3;3U~5J zh*m=XD+iv~4xv=iF%~zwD!b1y$Odn2bA~q+H_FsSUO&JeNL6S$3FbM)UCbA0M!^b# zTII=khAe~lUkpL3T5YEUmZ5n^BgM{<(-07PBF(9T(pM_p7m~!|0tggs1Fe7pZ|=j> zOl7^b2+Y#IN(S6(3>u3(C8^TialZs8A*RV3i<_(Sa_1*z78V@(wW^}y8c!)-ncez2 z5F*{tAWiX=LRxg7f0|e;0EXhWadiN0J4*bNZ7m8w&EHj`s!)VGhvf|fjdDNk%`lkBhT1eJ0<@JuR+ztv}HU+^XGQXEb z-M9ym-M8Y25=zb;SqZdQ?-MJ=bA4Zr{usivrKiKb0}ro~C^C2l6heed7yLq_LDBg< zj48U+<8m!KU6ujW+D>uVZI2nPW8r5p^9(S9CEXTo`yc}Ls49@Ax2wz0IelnhaQ=cE z?^E#BAuu_C$;tv^H~8fa6JNrks(&&?fGxSVC6P`{LNZ>{^kIL&mF2lDst+K&0lq}> zK1QNrkM}S;{a>8}Bo*C*^8!nhp%XLpZV)~|nV|gXJ=M7AK^w{DU-^}9A;QHVroN0{ z&C!^ERSbecp|pa|tAa~_ z%EuClC~uqObv`&aIG)8JdD)fYll{W?c=*lHp+=_e`XN9gtE3B^07Ocn?ZGGVF96s- z)&JlIs6CDbg!jLFV#R+MCA=qqt6?NBdp` z%&*k^g>t6J(*^wH*p@c&oA<;6T2^?Vdhh0a35UwLFBcoy zfNm;>P#%z!ZvHR1E||`Yb=2eV1*3H%MMl`$9D<}27`5;mrN+RgT&pD( zWjs~JxB=c+=Caizoe4F=zZ^vhc)F!;iwoxl2}EBIL#+MftSr5vU?D|Jd6bp+S#8yG z)$TVcr4Q<~(=qyFNXEQZvwu}?ukCqgi*;c4s*6DebOH<7aqmDv-Mn%;qTGOeMe6{+ z-UDx=0^ZQ1q3`9(yX&4P@UyEiA;GIo@e5g_vDpGUe`hhbJ(CYz(G>E15KExCr{@Kr zWNHC~Xn>vt{yCbG2Nj!OVmkHRI9}(Op~n)SOG5&x$3|dguUGy4z(rS$8XsfsV264n zAz3G?(Hcc7oB=49sqJf*fR2ey+*f2b4WJeXXauDDaVC%h}cpcr6B$K0}{Bdx^cX(<*HcwD+iKMsT_T?Z*O0Zln^f^ zU2;Km2WdZLDB=NHdL0R*3qWgjf9542A}X^Sq(hLTpuPsONRR+xd_17n7-PQ8HZH?F zQhFps`c*8DCI8h^Qvd_L0{7GST^;Jcl@8v5Do6d zZ{;3VSPmwRe+~Wbt?c%Ish1Kx_F(?QV!_}So_9Y!0{fynWvJ~r?CzFy2)`}Lxbd(D z0%%!f0RmiJK6Lh22%vQV`O5ZW>HctbFklAIKt6T!G!)1MPDcE@=ELg+55^#)7T@bc zPNQaE;{kG^TVR|B^huWhQU6ad44mw07=gph%*^Co_IxsZ@E`N7Txx)}n)2gaTVV9c z(POs^9CSDV!%`andIV6C8fj`WP2wpL|KI<8h5pn ziT`_tN@-qxes^HL;tU;n`+xoN;q{_-#akJ3pUcy99!q6?{WSfDy!5YNrfJ-pc@dy+ zFf5Bw0&vBk$kE$qI#D6_9Tt+2ni7Ks0y>eu01>oUZXS+#+OO1Z-^xGtU4{~8*jF)L zhy4}@f%kP&3b-&QCkMbszQCy&a&{dqr{%V(sVU&V5Lg-oC|&+3|6abd*qJJe1Nsf& z4|~9|8uz_9)*{IxjfD5B?5~}*CFFO{~vnb*ZJ-JNv@WJUdqLvz%k7`@-oV>5~+9o F{|DLYfr0=4 diff --git a/win8.1/encyclopedia/Encyclopedia/images/ep-storelogo.png b/win8.1/encyclopedia/Encyclopedia/images/ep-storelogo.png deleted file mode 100644 index 34f3626747a58ef275b5f97a657d10eb883b3123..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 999 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf1AIwDK~!i%?U-Lk zWOWqBzt}s@()3g zK@Xdx;6o~kP%cT~pPDkY)X8RWXB?YBXYRN2J9l;{Dq@FyxW(@ScYf!b-??{w-`_dE z`*0l!_#aS|8~^iIA%4RO@f%i%->^dbh85yBtPsCph4>9C#BW$3e!~j+Hx3RCkj-Xu zUg0o%D%Xi;>+j#ALe9?4;5bhHdKe2RFE7W+%1X{F949&e=a)CZ^<_^r#)ZzlaQ&YDbCK$dK0-n?d+9>zn!&a_k}3McfMgcABpL;j4k zwY6b+c^T8w({NoE(n6Y0UtbSt4-5|vqobn((n^R#B9L}Lad9yQ1_m^5b#)aL6&2|2 z?$!-yZEZy`7}QPL+uOs~*cig$A2io2jG1FuNDRF38E~-%xca&r!rMUNV>rRbMb!JU zv+n?*SAa{mM67JUm6yeT2?$=3b0UJTz2!a6pmiyLhK2@hl?Nw7eqHe2{v+P&ssK!- z%xn9>34k}H3SKuqH0;-SzhQ;=4J*WNSRsDH3h^6Oh~Kb6{Du|cH>?o9VTJe$;CIhz V)R@?Xc&z{c002ovPDHLkV1goo*%1H$ diff --git a/win8.1/encyclopedia/Encyclopedia/images/ep-widetile.png b/win8.1/encyclopedia/Encyclopedia/images/ep-widetile.png deleted file mode 100644 index 216dddc289d9c2f5017dd147da0f56462810d861..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7011 zcmd^ERZ|>Hu*F$?aS|W|cLE`V;IMdbcUyul9wa!sxCD0y?hb*#Vhe%b65QQ2xWnbE z`+EPueHiJgsi~fx?$gtA!c~=J@vvWGBOxK-$;(NpBOxJwe3>T$FkX7inS%3|0oheu z7KBtaLbdlIpjk;MNgyHB#^5}dp})vjPI7v#NJ#kI|25@Cq}Mm{QWBb;#z$G0 zK2%c;e@2Z+73w(o=l*;&)xb+NMhOhq`-T?(4-h1~ivoubk*c#z$N(zl3UNIAp{X&21f(qKe0f9V!I{G=z|#Wu_Ch$q7c%w7Sb7Z zp*13OA}sLya1K+`X}@1O89*fvep_Azx2*}j(A(FV+sj zLn&;q8o$(RG3do-u!=1WYK#220l8iZTCwS-W553MG*IVZF|LTR7TC0A zYi0JV_O70|Cp8HHrsOsan4F&eqyJAIB)9ShcV6Z2-%12^Q}t|mIQ)>~{jO?UTtc^I zB~5GDiP~7jE{s5wMeK1;1*Yb43_sv{CFnwt8($MIs} z%EDx+#!^!yp0>n^nNV_=eOA$+4meKFapAxHs5~-^IU4P~wngSG4|G>}+ePANT4lZ4 zo*o^g<}d2Ma!e}it%myIE|lF18ld&&T`GvY;r;4=NyV{ss(P2%>@Ylwmx79+hc1 z^y;LR{qF6*T~6t2O{j>u(IJ^3+*|pVt;TXB-rG*H%vtA0FZ!*CIOjf{#`xntef9{! zeMJ{a?r9tChrlNG@1yB< zRje8IjcJE9zwv|hU^p~m2l;#yn`8d6JfvwI78AqZ4C7?Y!4_pmfq9j~;n;$Y(jTwV z$qoIs2Dzy}(u~>q3rt0q#3JF#&g9i!hsLEHp}=9yhFQ(Z)H5~kUG&WL+-Jz`E_76l z*^u+@&9I}z(~)Ye+&iND=ebGo#|-*zP5ZKJZyg>B)W~16uiv=zvg2yhD{bpaBXuTC zk7_y67OvNY+ch&_Itv&!}@$jhUJEtL%Tj zu#%ZX7FyXj|Jm64h>sa^P*MMV<_yt|g~qh9i6uqCmwI%xM%FD$HIlx}+*&|3v zGQE-dw8<dlX{4`C9yf8313=p|&bDy~`#cPx`U%32JO~)0PO)`-STI=kh zEuS;~vReyIH)d6yZJ$>PwwB=TGrJL>L-nV^g@aRC%e$&h<|>{Weab+@y)E+Lm1C3# z0c{s2$EE9HA7+g|v1hUix^629ob}OXA#SDcRvBPDZu2(9{TeDFq%Rt|)$C-tet%de z?}&YIe38bIz*oGMP5v(slwJY>h-`_)cqE)0L zUUO5sc5}2!4iCxO4sD5Xan&r}wDx7LMA$T$`1{M?vMYA1BwuSeRZVYsxeZR%4Z`dn z^$!nS-Bui;N%%||DxpOvLiZ?39menJemf9EfOikSkR_?syHq)c8Zy-_|3vhyp zU5rU~vWWhdLhg-dfNk}oq6^Iqz)=fyGA+#q9CGW#e~7Zc1sV*ncgs=Hu>}4}+w~7B z=WfC({9o?^DCYI7vbHL!)B`>-b6hG9Hkt09XsWT-iN31Zisy$)0Gyh)S4zk!bGvK!DX${;SC^xP8NtDUUYvKWtI!Rzx3e8v$p#qt zRaBm&KH@JWYNkl%vibBk2ZmyCwTN_ds$Bg5S&~!q+efJ^PQ~rsYsHYlM zY)YF-&*hN3*Xig`Mjj~kyn+V7n}YRy0V{{H@2z`r|P%4V&>D;AZ935J|qF7Ml@ z4Ej7LZAh1W9QU7@ynbD&(9kYkE!lK4lI}C$tr0u_O!UeaSMYiX9cFp0PM%z?9Y1Ov#w&RZHC$5A40@sML2*PcKd@z7n zVL+oITIvvu3HZu28|uTEa+4vBFr~>YGN54|OH^^t8$1uH`0;1w(#p#@ z#B^{5SSqA6v?|#%2`T(DfW|j_VfpcpK?EQM5ED&Rvftl#F&LU12`!Nc)9=y0Gv0xZ z#<$JROLl|f^HMsk>a`5^M6=T7QsBJZxbr4M0Y^QWj-`W^@b-k%+}?oolAx3sE3s=TotwaZ{3IHS4`rn6c3kzN3mxcnU$AH9U-7BO z0Xw!`PLJsS_6C=hm%AntEep+zzY_8KdH8F^ud_s`X0|IJa-X=3$NW!IT9+YL%i;U# zFeF8$9Jb9dNdh-A=jW%#C28nJ=;NaQ^W)atL3K=42obvBH${EZcxK!o_x1bV(J0x4 zu8pt3AtxkcbW)?36%xA89#cDaVqU{{HT%PtLj>KtQ!40Il00t3kw?V~BCDQrR30P( zHsfgQ&E7XCSv;!Wzm#3x4-hgGn9M#s(-yTJ3)Fqf*gRulC?aZKjjd2HM3a zmD(HPk3L&&4kl)L>3(*RxQ|JFIjAt5D>}*V;ouoe5=OOd z+x)Pva2!ih>Y=W%X~hbEM5g zn_CYik4n=dAVp0c#>r&j!nq2`Yv-lWzQ}y#4)xRf;XvB=j?$~5edJlhBeK4sgzxX2 zGj|_ym4m-qwC|46*8IM^`|ztnhJ^d86GP<%62cXY!yK4qcbA60;%7%H7{OrowHKiV zp)nPM5g&?n?9^Sq$w=jx!`>KW7`$k?fMrW-y$GSeEodX@2dXA(3{wIZ@4#p z!_k&@BNyJ{CxUziP}K?R{?=yv#qHEAv$M8c)7>sgFQ}Fr$L==jIRwhA4VdL z^M$H?ssRooL|}i8kSGZvwdu3u3K@^pqC==@k*dLPf ze!AgVq+W%+nrEzT#+hyz(oAXU*)Y}@VXkME@To>6HJ@UO{7YOp?muzDY8WiLfdk$# zqIYlfv;38rCf}mxWW=;meQNVkesz~vY#0BVER4sdgieI%_2{`6m3@*zPeQJ{B@~NL z(A-BNvd`y0G`;oPDu0hqba3aucF1(JB(5#y{yP#)X$ec4T6Q2HO+x(yndP>M?x8hF zNrg^`4s5t(sbzEN?%~IK37MzaG>DJe6G|Li*}UZYXhTC*9SUtngswPT`rRGi;3wFy zCO*{I0g&d9Sy9vg&#!-4U=%D)ZsjPlFMC}!Y<#j9T0f8dCD=t;L1|Kv1ud5(4+&Ye zRGp$p?w@CivX6jCO>5(d-@WN1X=1=_AGyu}R^DqMiHq=g5`r{6fU4t)8}8Z4JDsks z^FE2~0U8M_r{GR|6z}vQDe`fuAyb;%RPVR(lo}e^(CSV$NeD~QpUo3D)>(8Z@OgVZ z)Jv=)Ojr^A@O0flFb#J(tnKxZrri%RO2&==cQSmBSyUA#X+9k@T;09~w9|P3<5cH0 zD7x44{*jb;6gS~Mfok`w7MfGOT`v^6nSu+w@@D5@3`QP53S?L4_nuBcB+h!J!JKTP zxKjWpJcUkuyGl}hP9*L?zNyOH4|kp8+QV|FJo0A#h zee?CQw^4%xMN>dNlTzNIk`G1!?1Jf2k!U&I{rTD8)2nt!UKtC}PI~;S#Luk``DQ-| zVepK@^an&Lb}iTM70Ib0uLd*Gn%`Q1|!dGefw_}J$DP2x|j#F zx(o}Ju;Sc%adZj7@Itd$KS~Tc+8jM|yEo2u8C*q$P3eQ68hc)?oGvT=X#Kp>k%C<+ zL&~D7-S|e(%WdH$16_uFa@>Gti1kfH=>}Dl8n7xC35KEZ1^Xa6w6XV%H(I_^>Gsoo~^8(w5D*3Xcvk>7UOsI$E5ys1C;}B;!!YlwFF{@~WssmL3RvSs>qC z5mr%Gz^xqcBFD0~}!||&nlpxGN^WYz3%(kC@FBT8J*L60;p8$x> z4t=dukc%Md*)gtpJJFV_xg^4!@o=8~ytv?1N__bH<&6hs86@BV8Fp(LFXczkrH1 zG$g|8ifj3Xvo!b@Cusx9VYzO_MHhzZHq448vCLkDgau`E#~7uxDt12#hpP#pC+{0< z-#GUtT(vYlh&CR8NrID3Ne1JjVRZLw>e)y12yX)9brb;~FL15T6W%oWbF<-oeO>$L z4~+666WU!htwds*imyEL&}PNJHb8=p<^`Imh>?>9`Zamne%dd|hc?{g6yVjDsL9v0 zVWk6d-esKR@;V1@MSNnoYa&%zdIe^m#>F_T*#`}j7@S#M>wG7zA7H4pos)LQ)RR$n zW43Zx#72}Y*c~Wq@q7Bz6k5qo9kVvt9+)Q5;9Ps}I#)HQvF6rT1a8NM2}o?NPk(Ta zA3YktNI+=^`v#ZL*l0 z12MIp4_)c9*UN+{5!613y2OMf1T_|tJyETSJ=_(AHjr8+izyA+ZTy zLw#%$Iik^bi8%t9Gtlp0qpC9a?@t~`2r#Hklyd0K?73^7)Qok_Mz+r=5*0d^N+^vB zsO%*)kyHen;x~nb^>+?~4Cpj5-l|jrxv|z126}KAIkGI!@jk=}BAayzGHC&OyP_<1 ztPoH=#YEp=(ntEMEpKDA^#p6<@G3TE#Hpl#t1twE03u`Oruf0Mh~yqsqL)Yd-sLA! z46pNeFh$G?YU3$mT<~?oPruyi>KQznwx05Z7%PLTjGQj#ngZdr@paRQN^r6wS<6lT zkax~6ef?2t8x5S#jvrZuKbNYe;Hj~@WFC~+m0!weY6o~0lZSIOO`xwXoeT1WG=yCw zV3SU#XZ7HUI@!qh!}sublzzwCk)VC4?@{-oe!LuC*<|E(E)A@bvZ)9Ib(Kb zVN5I)7@JaF^s96V>TTUVt8EYmB}t<(#@wSE=#ucNh72TUraJ3I==n%)?3w#3g#xUo z7IR1+)D7#JM$JiI^XRzGDwh)PCqlEoyV$GJCLz#14Gc})w5yQ=^b;@>cm)uM-k9zk zvbzj$C!|*|V(~_46e+T@NW(S}{isBU@{&-A`%|Ahj8jQlEa~XjaRj@K0PF$IUe%O0 zlg%V87oS_hDI0s_Kg>7d)D;j*Bxz=V|8_e>nUuv>@NPFBRv8ql-q{a(gXGNjlMm$o zDbYOFgR&c!Ku`jOYak^LJ`}$$H`=VJVyz bpOIr+f;REDB&1)6F(i3uWvMEVDfE8;)&NnU diff --git a/win8.1/encyclopedia/Encyclopedia/js/data.ts b/win8.1/encyclopedia/Encyclopedia/js/data.ts deleted file mode 100644 index e65689b..0000000 --- a/win8.1/encyclopedia/Encyclopedia/js/data.ts +++ /dev/null @@ -1,117 +0,0 @@ -/// -/// -/// - -module Data { - "use strict"; - - export interface UserData { - favorites: string[]; - recent: string[]; - today: string[]; - } - - export interface Group { - key: string; - title: string; - } - - interface Groups { - [idx: string]: Group; - } - - var groupsHash = ({ - recent: { key: 'recent', title: 'Recent' }, - favorites: { key: 'favorites', title: 'Favorites' }, - today: { key: 'today', title: 'Today' }, - nearby: { key: 'xxnearby', title: 'Nearby' } - }); - - var list = new WinJS.Binding.List([]); - - function saveUserData() { - Windows.Storage.ApplicationData.current.localSettings.values["userdata"] = JSON.stringify(userData); - } - - var userdatastring: string = Windows.Storage.ApplicationData.current.localSettings.values["userdata"]; - var userData: UserData; - //if (userdatastring != null) { - // userData = JSON.parse(userdatastring); - //} else { - userData = { - favorites: ['Topology', 'Windows 8', 'Windows Phone 7'], - recent: ['Einstein', 'Quantum Field Theory', 'Einstein Field Equations', 'Macleay\'s Swallowtail', 'Gödel metric'], - today: ['Transformers', 'XBox', 'Mount Rainier', 'Independence Day (film)', 'Independence Day', 'Roland Emmerich', 'Padmanabhaswamy Temple'] - }; - saveUserData(); - //} - Object.keys(userData).forEach(function (groupName) { - msSetImmediate(function () { populate(groupName, userData[groupName]); }); - }); - - function populate(groupName: string, itemTitles: string[]) { - for (var i = 0; i < itemTitles.length; i++) { - list.push(createTopicFromTitle(itemTitles[i], groupsHash[groupName])); - } - } - var locator = new Windows.Devices.Geolocation.Geolocator(); - locator.getGeopositionAsync().then(function (pos) { - var lat = pos.coordinate.latitude; - var long = pos.coordinate.longitude; - var url = 'http://api.wikilocation.org/articles?radius=100000&limit=10&lat=' + lat + '&lng=' + long; - return WinJS.xhr({ url: url }); - }).then(function (xhr) { - var data = JSON.parse(xhr.responseText); - addTopicsToGroup(data.articles, groupsHash['nearby']); - }).done(); - - function addTopicsToGroup(articles: { title: string; }[], group: Data.Group) { - articles.forEach(function (article) { - msSetImmediate(function () { - list.push(createTopicFromTitle(article.title, group)); - }); - }); - } - - export function addFavorite(title: string) { - if (userData.favorites.indexOf(title) == -1) { - userData.favorites.push(title); - saveUserData(); - var topic = createTopicFromTitle(title, groupsHash['favorites']) - list.push(topic); - Encyclopedia.addToTile(title, topic.localImageSrc); - } - } - - export function removeFavorite(title: string) { - var i = userData.favorites.indexOf(title); - if (i != -1) { - userData.favorites.splice(i, 1); - saveUserData(); - var j = list.indexOf(createTopicFromTitle(title, groupsHash['favorites'])); - if (j != -1) { - list.splice(j, 1); - } - } - } - - var groupedItems = list.createGrouped(groupKeySelector, groupDataSelector); - - function groupKeySelector(item) { - return item.group.key; - } - - function groupDataSelector(item) { - return item.group; - } - - export function getItemsFromGroup(group: Group) { - return list.createFiltered(function (item) { return item.group.key === group.key; }); - } - - export var items = groupedItems; - export var groups = groupedItems.groups; - export function getItemReference(item) { - return [item.group.key, item.title]; - } -} diff --git a/win8.1/encyclopedia/Encyclopedia/js/default.ts b/win8.1/encyclopedia/Encyclopedia/js/default.ts deleted file mode 100644 index ee582bd..0000000 --- a/win8.1/encyclopedia/Encyclopedia/js/default.ts +++ /dev/null @@ -1,82 +0,0 @@ -/// -/// - -module Default { - "use strict"; - - var app = WinJS.Application; - var activation = Windows.ApplicationModel.Activation; - var nav = WinJS.Navigation; - //WinJS.strictProcessing(); - - var searchPane = Windows.ApplicationModel.Search.SearchPane.getForCurrentView(); - searchPane.onquerysubmitted = function (ev: Windows.ApplicationModel.Search.ISearchPaneQuerySubmittedEventArgs) { - var topic = createTopicFromTitle(ev.queryText, null); - WinJS.Navigation.navigate('/html/itemDetailPage.html', { item: topic }); - } - - searchPane.onsuggestionsrequested = function (ev: Windows.ApplicationModel.Search.SearchPaneSuggestionsRequestedEventArgs) { - var deferral = ev.request.getDeferral(); - var url = 'http://en.wikipedia.org/w/api.php?action=opensearch&limit=20&search=' - + encodeURI(ev.queryText); - WinJS.xhr({ url: url }).then(function (xhr) { - var data = JSON.parse(xhr.response); - ev.request.searchSuggestionCollection.appendQuerySuggestions(data[1]); - deferral.complete(); - }); - } - - var settingsPane = Windows.UI.ApplicationSettings.SettingsPane.getForCurrentView(); - settingsPane.oncommandsrequested = function (ev: Windows.UI.ApplicationSettings.SettingsPaneCommandsRequestedEventArgs) { - ev.request.applicationCommands.push(new Windows.UI.ApplicationSettings.SettingsCommand("1", "Encyclopedia Settings", function (a) { - var panel = document.getElementById('KnownSettingsCommand.Preferences'); - WinJS.UI.process(panel); - })); - }; - - app.addEventListener("activated", function (args: WinJS.Application.ApplicationActivationEvent) { - if (args.detail.kind === activation.ActivationKind.launch) { - var launchEv = args.detail; - - if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) { - // TODO: This application has been newly launched. Initialize - // your application here. - } else { - // TODO: This application has been reactivated from suspension. - // Restore application state here. - } - - if (app.sessionState.history) { - nav.history = app.sessionState.history; - } - args.setPromise(WinJS.UI.processAll().then(function () { - if (nav.location) { - nav.history.current.initialPlaceholder = true; - return nav.navigate(nav.location, nav.state); - } else { - if (launchEv.arguments !== '') { - var topic = createTopicFromTitle(launchEv.arguments, null); - nav.navigate('/html/itemDetailPage.html', { item: topic }); - } else { - return nav.navigate(Encyclopedia.navigator.home); - } - } - })); - } else if (args.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.search) { - var searchEv = args.detail; - WinJS.UI.processAll(); - var topic = createTopicFromTitle(searchEv.queryText, null); - WinJS.Navigation.navigate('/html/itemDetailPage.html', { item: topic }); - } - }); - - app.oncheckpoint = function (args) { - // TODO: This application is about to be suspended. Save any state - // that needs to persist across suspensions here. If you need to - // complete an asynchronous operation before your application is - // suspended, call args.setPromise(). - app.sessionState.history = nav.history; - }; - - app.start(); -} diff --git a/win8.1/encyclopedia/Encyclopedia/js/groupDetailPage.ts b/win8.1/encyclopedia/Encyclopedia/js/groupDetailPage.ts deleted file mode 100644 index 0f3c4fe..0000000 --- a/win8.1/encyclopedia/Encyclopedia/js/groupDetailPage.ts +++ /dev/null @@ -1,76 +0,0 @@ -/// -/// - -module GroupDetailPage { - "use strict"; - - var nav = WinJS.Navigation; - var ui = WinJS.UI; - var utils = WinJS.Utilities; - var views = Windows.UI.ViewManagement; - var group: Data.Group; - var items; - - function updateLayout(element: HTMLElement) { - var listView = element.querySelector(".groupList").winControl; - - if (views.ApplicationView.value === views.ApplicationViewState.snapped) { - listView.layout = new ui.ListLayout(); - } else { - listView.layout = new ui.GridLayout({ groupHeaderPosition: "left" }); - } - } - - function ready(element: HTMLElement, options: { group: Data.Group; }) { - group = (options && options.group) ? options.group : Data.groups.getAt(0); - items = Data.getItemsFromGroup(group); - var pageList = items.createGrouped( - function (item) { return group.key; }, - function (item) { return group; } - ); - var groupDataSource = pageList.groups.dataSource; - - element.querySelector("header[role=banner] .win-type-xx-large").textContent = group.title; - setupMenu(element); - - var listView = element.querySelector(".groupList").winControl; - ui.setOptions(listView, { - itemDataSource: pageList.dataSource, - itemTemplate: element.querySelector(".itemTemplate"), - groupDataSource: pageList.groups.dataSource, - groupHeaderTemplate: element.querySelector(".headerTemplate"), - oniteminvoked: itemInvoked - }); - } - - function itemInvoked(e) { - var item = items.getAt(e.detail.itemIndex); - nav.navigate("/html/itemDetailPage.html", { item: item }); - } - - function setupMenu(element: HTMLElement) { - var commandList = []; - Data.groups.forEach(function (group) { - commandList.push({ - label: group.title, onclick: function () { - nav.navigate("/html/groupDetailPage.html", { group: group }); - } - }); - }); - - var menu = new ui.Menu(element.querySelector("header[role=banner] .menu"), { commands: commandList }); - var title = element.querySelector(".titleArea .win-type-xx-large"); - - title.onclick = function (eventObject) { menu.show(title, "bottom", "left"); }; - title.onkeypress = function (eventObject) { - if (eventObject.keyCode === utils.Key.enter || eventObject.keyCode === utils.Key.space) { - menu.show(title, "bottom", "left"); - } - }; - } - - ui.Pages.define("/html/groupDetailPage.html", { - ready: ready, - updateLayout: updateLayout - }); -} diff --git a/win8.1/encyclopedia/Encyclopedia/js/groupedItemsPage.ts b/win8.1/encyclopedia/Encyclopedia/js/groupedItemsPage.ts deleted file mode 100644 index 4a160e6..0000000 --- a/win8.1/encyclopedia/Encyclopedia/js/groupedItemsPage.ts +++ /dev/null @@ -1,163 +0,0 @@ -/// -/// - -module GroupedItemsPage { - "use strict"; - - var appView = Windows.UI.ViewManagement.ApplicationView; - var appViewState = Windows.UI.ViewManagement.ApplicationViewState; - var nav = WinJS.Navigation; - var ui = WinJS.UI; - var utils = WinJS.Utilities; - - ui.Pages.define("/html/groupedItemsPage.html", { - - // This function updates the ListView with new layouts - initializeLayout: function (listView, viewState) { - - if (viewState === appViewState.snapped) { - listView.itemDataSource = Data.groups.dataSource; - listView.groupDataSource = null; - listView.layout = new ui.ListLayout(); - } else { - listView.itemDataSource = Data.items.dataSource; - listView.groupDataSource = Data.groups.dataSource; - listView.layout = new ui.GridLayout({ groupHeaderPosition: "top" }); - } - }, - - itemInvoked: function (args) { - if (appView.value === appViewState.snapped) { - // If the page is snapped, the user invoked a group. - var group = Data.groups.getAt(args.detail.itemIndex); - nav.navigate("/html/groupDetailPage.html", { groupKey: group.key }); - } else { - // If the page is not snapped, the user invoked an item. - var item = Data.items.getAt(args.detail.itemIndex); - nav.navigate("/html/itemDetailPage.html", { item: item }); - } - }, - - // This function is called whenever a user navigates to this page. It - // populates the page elements with the app's data. - ready: function (element, options) { - var listView = element.querySelector(".groupeditemslist").winControl; - listView.groupHeaderTemplate = element.querySelector(".headerTemplate"); - listView.itemTemplate = element.querySelector(".itemtemplate"); - listView.oniteminvoked = this.itemInvoked.bind(this); - - var appbarControl = ( document.querySelector('#appbar')).winControl; - appbarControl.hideCommands(['addfavorite', 'removefavorite', 'pin']); - - this.initializeLayout(listView, appView.value); - listView.element.focus(); - }, - - // This function updates the page layout in response to viewState changes. - updateLayout: function (element, viewState, lastViewState) { - - var listView = element.querySelector(".groupeditemslist").winControl; - if (lastViewState !== viewState) { - if (lastViewState === appViewState.snapped || viewState === appViewState.snapped) { - var handler: (e: Event) => void = function (e) { - listView.removeEventListener("contentanimating", handler, false); - e.preventDefault(); - } - listView.addEventListener("contentanimating", handler, false); - this.initializeLayout(listView, viewState); - } - } - } - }); - - - - //"use strict"; - - //var appView = Windows.UI.ViewManagement.ApplicationView; - //var appViewState = Windows.UI.ViewManagement.ApplicationViewState; - //var nav = WinJS.Navigation; - //var ui = WinJS.UI; - //var utils = WinJS.Utilities; - - //function updateLayout(element: HTMLElement) { - // var listView = element.querySelector(".landingList").winControl; - // if (appLayout.value === appLayoutState.snapped) { - // ui.setOptions(listView, { - // itemDataSource: data.items.dataSource, - // itemTemplate: element.querySelector(".itemTemplate"), - // groupDataSource: null, - // oniteminvoked: itemInvoked - // }); - - // listView.layout = new ui.ListLayout(); - // } else { - // var groupDataSource = data.items.createGrouped(groupKeySelector, groupDataSelector).groups; - - // ui.setOptions(listView, { - // itemDataSource: data.items.dataSource, - // itemTemplate: element.querySelector(".itemTemplate"), - // groupDataSource: groupDataSource.dataSource, - // groupHeaderTemplate: element.querySelector(".headerTemplate"), - // oniteminvoked: itemInvoked - // }); - // listView.layout = new ui.GridLayout({ groupHeaderPosition: "top" }); - // } - //} - - //function groupKeySelector(item) { - // return item.group.key; - //} - - //function groupDataSelector(item) { - // return { - // title: item.group.title, - // click: function () { - // nav.navigate("/html/groupDetailPage.html", { group: item.group }); - // } - // } - //} - - //function ready(element: HTMLElement, options) { - // var appbarControl = ( document.querySelector('#appbar')).winControl; - // appbarControl.hideCommands(['addfavorite', 'removefavorite', 'pin']); - - // setupMenu(element); - //} - - //function itemInvoked(e: {detail: {itemIndex: number; }; }) { - // //if (appLayout.value === appLayoutState.snapped) { - // // var group = data.groups.getAt(e.detail.itemIndex); - // // nav.navigate("/html/groupDetailPage.html", { group: group }); - // //} else { - // var item = data.items.getAt(e.detail.itemIndex); - // nav.navigate("/html/itemDetailPage.html", { item: item }); - // //} - //} - - //function setupMenu(element: HTMLElement) { - // var commandList = []; - // //data.groups.forEach(function (group) { - // // commandList.push({ - // // label: group.title, onclick: function () { - // // nav.navigate("/html/groupDetailPage.html", { group: group }); - // // } - // // }); - // //}); - - // var menu = new ui.Menu(element.querySelector("header[role=banner] .menu"), { commands: commandList }); - // var title = element.querySelector(".titleArea .win-type-xx-large"); - - // //title.onclick = function (eventObject) { menu.show(title, "bottom", "left"); }; - // //title.onkeypress = function (eventObject) { - // // if (eventObject.keyCode === utils.Key.enter || eventObject.keyCode === utils.Key.space) { - // // menu.show(title, "bottom", "left"); - // // } - // //}; - //} - - //ui.Pages.define("/html/groupedItemsPage.html", { - // ready: ready, - // updateLayout: updateLayout - //}); -} diff --git a/win8.1/encyclopedia/Encyclopedia/js/itemDetailPage.ts b/win8.1/encyclopedia/Encyclopedia/js/itemDetailPage.ts deleted file mode 100644 index 53d8205..0000000 --- a/win8.1/encyclopedia/Encyclopedia/js/itemDetailPage.ts +++ /dev/null @@ -1,88 +0,0 @@ -/// -/// -/// - -module ItemDetailPage { - "use strict"; - - var ui = WinJS.UI; - var utils = WinJS.Utilities; - - function ready(element: HTMLElement, options: { item: Topic; }) { - - var item: Topic = options && options.item ? options.item : Data.items.getAt(0); - element.querySelector(".titlearea .pagetitle").textContent = item.title; - var content = element.querySelector('.content'); - goToPage(content, item); - document.body.focus(); - setupMenu(element); - - var appbarControl = document.querySelector('#appbar').winControl; - appbarControl.showCommands(['addfavorite', 'removefavorite', 'pin']); - var pin = appbarControl.getCommandById('pin'); - pin.onclick = function handler() { - var uri = new Windows.Foundation.Uri("ms-appdata:///local/" + item.localImageSrc); - var tile = new Windows.UI.StartScreen.SecondaryTile(); - tile.tileId = encodeURIComponent(item.title); - tile.displayName = item.title; - tile.shortName = item.title; - tile.arguments = item.title; - tile.tileOptions = Windows.UI.StartScreen.TileOptions.showNameOnLogo; - tile.logo = uri; - tile.foregroundText = Windows.UI.StartScreen.ForegroundText.light; - tile.requestCreateAsync().done(); - } - } - - function setupMenu(elements: Element) { - var commandList = []; - var menu = new ui.Menu(elements.querySelector('header[role=banner] .menu'), { commands: commandList }); - var title = elements.querySelector('.titleArea .win-type-xx-large'); - } - - - function goToPage(rootElem: HTMLElement, topic: Topic) { - - topic.htmlContent.done(function(bodyInnerText: string) { - //document.querySelector(".win-contentTitle").innerText = topic.title; - MSApp.execUnsafeLocalFunction(function() { - rootElem.innerHTML = toStaticHTML(bodyInnerText); - Array.prototype.forEach.call(rootElem.querySelectorAll('*[href]'), function(a: HTMLAnchorElement) { - a.addEventListener("click", function(ev) { - //console.log("Clicked: " + ev.target + ", " + ev.currentTarget.href); - ev.preventDefault(); - var url = a.href; - if (url.indexOf('ms-appx:') == 0) { - var i = a.href.lastIndexOf('\/'); - var topicRef = decodeURIComponent(a.href.slice(i + 1)).replace(/_/g, " "); - var topic = createTopicFromTitle(topicRef, null); - WinJS.Navigation.navigate("/html/itemDetailPage.html", { item: topic }); - } - else { - var dialog = new Windows.UI.Popups.MessageDialog("This link will take you to an external page. Would you like to launch the browser?", "Open external browser?"); - dialog.commands.push(new Windows.UI.Popups.UICommand("launch browser", function() { - // External page - Windows.System.Launcher.launchUriAsync(new Windows.Foundation.Uri(url)).done(); - })); - dialog.commands.push(new Windows.UI.Popups.UICommand("cancel", function() { })); - dialog.showAsync().done(); - } - }) - }); - }); - - }, noInternetConnection); - } - - function refreshCurrent(element: Element) { - var title = element.querySelector(".itemDetailPage header[role=banner] .pagetitle").textContent; - var topic = createTopicFromTitle(title, null); - downloadAndCacheLocally(topic); - goToPage(element.querySelector('.content'), topic); - } - - ui.Pages.define("/html/itemDetailPage.html", { - ready: ready, - refreshCurrent: refreshCurrent - }); -} diff --git a/win8.1/encyclopedia/Encyclopedia/js/navigator.ts b/win8.1/encyclopedia/Encyclopedia/js/navigator.ts deleted file mode 100644 index 7a71698..0000000 --- a/win8.1/encyclopedia/Encyclopedia/js/navigator.ts +++ /dev/null @@ -1,194 +0,0 @@ -/// -/// - -module Encyclopedia { - "use strict"; - - var appView = Windows.UI.ViewManagement.ApplicationView; - var displayProps = Windows.Graphics.Display.DisplayProperties; - var nav = WinJS.Navigation; - var ui = WinJS.UI; - var utils = WinJS.Utilities; - - export var navigator: PageControlNavigator = null; - - export class PageControlNavigator { - - public element = null; - public home = ""; - public lastViewstate = 0; - - // Define the constructor function for the PageControlNavigator. - constructor(element: Element, options: { home: string; }) { - this.element = (element || document.createElement("div")); - this.element.appendChild(this._createPageElement()); - - this.home = options.home; - this.lastViewstate = appView.value; - - nav.onnavigated = this._navigated.bind(this); - window.onresize = this._resized.bind(this); - - document.body.onkeyup = this._keyupHandler.bind(this); - document.body.onkeypress = this._keypressHandler.bind(this); - document.body.onmspointerup = this._mspointerupHandler.bind(this); - - Encyclopedia.navigator = this; - } - - private get pageControl() { return this.pageElement && this.pageElement.winControl; } - private get pageElement() { return this.element.firstElementChild; } - - // This function creates a new container for each page. - private _createPageElement() { - var element = document.createElement("div"); - element.style.width = "100%"; - element.style.height = "100%"; - return element; - } - - // This function responds to keypresses to only navigate when - // the backspace key is not used elsewhere. - private _keypressHandler(args) { - if (args.key === "Backspace") { - nav.back(); - } - } - - private _keyupHandler(args) { - if ((args.key === "Left" && args.altKey) || (args.key === "BrowserBack")) { - nav.back(); - } else if ((args.key === "Right" && args.altKey) || (args.key === "BrowserForward")) { - nav.forward(); - } - } - - private _mspointerupHandler(args) { - if (args.button === 3) { - nav.back(); - } else if (args.button === 4) { - nav.forward(); - } - } - - private _fwdbackHandler(e: KeyboardEvent) { - if (e.altKey) { - switch (e.keyCode) { - case utils.Key.leftArrow: nav.back(); break; - case utils.Key.rightArrow: nav.forward(); break; - } - } - } - - //private _viewstatechanged(e) { - // this._updateLayout()(this.pageElement, e.layout, displayProps.currentOrientation); - //} - - // This function responds to navigation by adding new pages - // to the DOM. - private _navigated(args) { - var oldElement = this.pageElement; - var newElement = this._createPageElement(); - var parentedComplete; - var parented = new WinJS.Promise(function(c) { parentedComplete = c; }); - - args.detail.setPromise( - WinJS.Promise.timeout().then(function() { - if (oldElement.winControl && oldElement.winControl.unload) { - oldElement.winControl.unload(); - } - return WinJS.UI.Pages.render(args.detail.location, newElement, args.detail.state, parented); - }).then((control) => { - this.element.appendChild(newElement); - this.element.removeChild(oldElement); - oldElement.innerText = ""; - this.navigated(); - parentedComplete(); - }) - ); - } - - private _resized(args) { - if (this.pageControl && this.pageControl.updateLayout) { - this.pageControl.updateLayout.call(this.pageControl, this.pageElement, appView.value, this.lastViewstate); - } - this.lastViewstate = appView.value; - } - - //private _updateLayout() { return (this.pageControl() && this.pageControl().updateLayout) || function() { }; } - - // This function updates application controls once a navigation - // has completed. - public navigated() { - // Do application specific on-navigated work here - var backButton = this.pageElement.querySelector("header[role=banner] .win-backbutton"); - if (backButton != null) { - backButton.onclick = function() { nav.back(); }; - - if (nav.canGoBack) { - backButton.removeAttribute("disabled"); - } - else { - backButton.setAttribute("disabled", "disabled"); - } - } - } - - } - WinJS.Utilities.markSupportedForProcessing(PageControlNavigator); - - export function navigateHome() { - var home = document.querySelector("#contenthost").winControl.home; - var loc = nav.location; - if (loc !== "" && loc !== home) { - nav.navigate(home); - } - } - WinJS.Utilities.markSupportedForProcessing(navigateHome); - - export function refresh() { - var control = (document.querySelector("#contenthost")).winControl; - if (control && control.pageControl && control.pageControl.refreshCurrent) { - control.pageControl.refreshCurrent(control.element); - } - } - WinJS.Utilities.markSupportedForProcessing(refresh); - - export function addFavorite() { - var control = (document.querySelector("#contenthost")).winControl; - if (control && control.pageControl && control.pageControl.refreshCurrent) { - var elem: Element = control.element.querySelector(".itemDetailPage header[role=banner] .pagetitle"); - var title = elem.textContent; - Data.addFavorite(title); - } - } - WinJS.Utilities.markSupportedForProcessing(addFavorite); - - export function removeFavorite() { - var control = (document.querySelector("#contenthost")).winControl; - if (control && control.pageControl && control.pageControl.refreshCurrent) { - var title = control.element.querySelector(".itemDetailPage header[role=banner] .pagetitle").textContent; - Data.removeFavorite(title); - } - } - WinJS.Utilities.markSupportedForProcessing(removeFavorite); - - export function addToTile(text: string, imgSrc: string) { - var tileUpdater = Windows.UI.Notifications.TileUpdateManager.createTileUpdaterForApplication(); - var template = Windows.UI.Notifications.TileTemplateType.tileWideImageAndText01; - var tileXml = Windows.UI.Notifications.TileUpdateManager.getTemplateContent(template); - var tileTextAttributes = tileXml.getElementsByTagName("text"); - tileTextAttributes.forEach(function(value, index) { - value.appendChild(tileXml.createTextNode("textField " + (index + 1))); - }); - var tileImageAttributes = tileXml.getElementsByTagName("image"); - var imgUri = new Windows.Foundation.Uri(Windows.Storage.ApplicationData.current.localFolder.path + "/").combineUri(imgSrc); - var elem = tileImageAttributes.getAt(0); - elem.setAttribute("src", imgUri.absoluteUri); - elem.setAttribute("alt", "graphic"); - elem.setAttribute("id", "1"); - var tileNotification = new Windows.UI.Notifications.TileNotification(tileXml); - tileUpdater.enableNotificationQueue(true); - tileUpdater.update(tileNotification); - } -} \ No newline at end of file diff --git a/win8.1/encyclopedia/Encyclopedia/js/topic.ts b/win8.1/encyclopedia/Encyclopedia/js/topic.ts deleted file mode 100644 index bcd0478..0000000 --- a/win8.1/encyclopedia/Encyclopedia/js/topic.ts +++ /dev/null @@ -1,180 +0,0 @@ -/// -/// - -interface Topic { - group: any; - title: string; - imageSrc: string; - localImageSrc: string; - htmlContent: any; -} - -var topiccache: { [name: string]: Topic } = {}; - -function createTopicFromUrl(url: string, group: Data.Group): Topic { - var encodedName = url.slice(url.lastIndexOf('/') + 1); - var title = decodeURIComponent(encodedName).replace('_', ' '); - return createTopicFromTitle(title, group); -} - -function downloadImageAndStoreLocal(bodyInnerText: string, topic: Topic) { - var imageSrc = findImage(bodyInnerText); - WinJS.xhr({ url: imageSrc, responseType: "blob" }).then(function (xhr) { - var blob = xhr.response; - topic.imageSrc = URL.createObjectURL(blob); - var encodedImageUri = imageSrc.slice(imageSrc.lastIndexOf('/') + 1); - topic.localImageSrc = encodedImageUri; - Windows.Storage.ApplicationData.current.localFolder.createFileAsync(encodedImageUri, Windows.Storage.CreationCollisionOption.replaceExisting).then(function (file) { - file.openAsync(Windows.Storage.FileAccessMode.readWrite).then(function (ras) { - var inputStream = blob.msDetachStream().getInputStreamAt(0); - var outputStream = ras.getOutputStreamAt(0); - Windows.Storage.Streams.RandomAccessStream.copyAsync(inputStream, outputStream).then(function () { - inputStream.close(); - return outputStream.flushAsync(); - }).done(); - }).then(function () { - Windows.Storage.ApplicationData.current.localSettings.values[topic.title + "image"] = encodedImageUri; - }); - }); - }); -} - -function createTopicFromTitle(title: string, group: Data.Group): Topic { - var topic = topiccache[title + "--" + (group && group.title)]; - if (topic) - return topic; - - // Create the topic as a databindable object - topic = WinJS.Binding.as({ - group: group, - title: title, - imageSrc: null, - localImageSrc: null - }); - - // Kick off the work to aquire the HTML content - var url = "http://en.wikipedia.org/w/index.php?title=" + encodeURI(title); - - var htmlContentPromise: WinJS.Promise; - var localContent = Windows.Storage.ApplicationData.current.localSettings.values[title]; - - // - htmlContentPromise = localContent ? retrieveCached(topic) : downloadAndCacheLocally(topic); - - // Don't want the topic to be tracked by the observable (TODO: I'm sure there is a 'better' way to do this) - topic.htmlContent = htmlContentPromise; - - topiccache[title + "--" + (group && group.title)] = topic; - return topic; -} - -function retrieveCached(topic: Topic) { - // If content is already available locally: - // 1) set the htmlContentPromise to read it from disk - // 2) in parallel, grab the image from disk and display it. - var title = topic.title; - var encodedTitle = encodeURIComponent(title); - var htmlContentPromise = WinJS.Application.local.readText(encodedTitle + ".html"); - var localImageSrc = Windows.Storage.ApplicationData.current.localSettings.values[title + "image"]; - topic.localImageSrc = localImageSrc; - - Windows.Storage.ApplicationData.current.localFolder.getFileAsync(localImageSrc) - .then(function (file) { - return file.openAsync(Windows.Storage.FileAccessMode.read); - }).then(function (ras) { - var blob = MSApp.createBlobFromRandomAccessStream("image/png", ras); - topic.imageSrc = URL.createObjectURL(blob); - }).then(null, function (err) { - // The image file wasn't available for some reason, - // retry downloading the image. - return htmlContentPromise.then(function (bodyInnerHtml) { - downloadImageAndStoreLocal(bodyInnerHtml, topic); - }); - }).done(); - - return htmlContentPromise; -} - -function downloadAndCacheLocally(topic: Topic) { - // If content is *not* already available locally, set htmlContentPromise to do the following: - // 1) read it from the network - // 2) then write it to local disk - // 2.5) also record in local settings that it is stored locally - // 3) find the associated image - // 4) set that as the databound imageSrc - // 5) write the image to disk - // 5.5) also record in local settings that it is stored locally - var title = topic.title; - var url = "http://en.wikipedia.org/w/index.php?title=" + encodeURI(title); - var htmlContentPromise = WinJS.xhr({ url: url }) - .then(function (result) { - var text = result.response; - var bodyStartStart = text.indexOf("", bodyStartStart) + 1; - var bodyEndStart = text.indexOf(""); - text = text.slice(bodyStartEnd, bodyEndStart); - text = text.replace(/"\/\//g, '"http://'); - return text; - }); - - var encodedTitle = encodeURIComponent(title); - - var bodyInnerText: string = null; - htmlContentPromise.then(function (innerText) { - bodyInnerText = innerText; - // Store text to local storage - return WinJS.Application.local.writeText(encodedTitle + ".html", bodyInnerText); - }).then(function () { - Windows.Storage.ApplicationData.current.localSettings.values[title] = encodedTitle + ".html"; - // Download the image and store to local storage - return downloadImageAndStoreLocal(bodyInnerText, topic); - }).done(null, function (err) { - if (err instanceof XMLHttpRequest) { - return; - } else { - throw err; - } - }); - return htmlContentPromise; -} - -function findImage(bodyHtml: string) { - var dummyDiv = document.createElement('div'); - dummyDiv.innerHTML = toStaticHTML(bodyHtml); - var imgs: HTMLImageElement[] = Array.prototype.slice.call(dummyDiv.getElementsByTagName('img'), 0); - imgs = imgs.filter(function (img) { - var widthAttr = img.attributes["width"]; - if (!widthAttr) return false; - var keep = (+widthAttr.value) > 100; - return keep; - }); - imgs.forEach(function (img, i) { - img.attributes["width"].value *= (1 - (i / imgs.length) / 2); - img.attributes["height"].value *= (1 - (i / imgs.length) / 2); - }); - imgs.sort(function (img1, img2) { - var awidth = +img1.attributes["width"].value; - var aheight = +img1.attributes["height"].value; - var bwidth = +img2.attributes["width"].value; - var bheight = +img2.attributes["height"].value; - return Math.min(bwidth, bheight) - Math.min(awidth, aheight); - }); - var jpgs = imgs.filter(function (img) { - var s = img.src; - if (s.slice(s.length - 4) == ".jpg" || s.slice(s.length - 5) == ".jpeg") - return true; - return false; - }); - if (jpgs.length > 0 && (+jpgs[0].attributes["width"].value > 100) && (+jpgs[0].attributes["height"].value > 100)) { - return jpgs[0].src; - } else if (imgs.length > 0) { - return (imgs[0]).src; - } else { - return "http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png"; - } -} - -function noInternetConnection(err) { - var flyout = new Windows.UI.Popups.MessageDialog("No internet connection"); - flyout.showAsync().done(); -} diff --git a/win8.1/encyclopedia/Encyclopedia/js/typings/winjs.d.ts b/win8.1/encyclopedia/Encyclopedia/js/typings/winjs.d.ts deleted file mode 100644 index 5d82286..0000000 --- a/win8.1/encyclopedia/Encyclopedia/js/typings/winjs.d.ts +++ /dev/null @@ -1,208 +0,0 @@ -/* ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module WinJS { - function strictProcessing(): void; - module Binding { - function as(data: any): any; - class List { - constructor(data: any[]); - public push(item: any): any; - public indexOf(item: any): number; - public splice(index: number, count: number, newelems: any[]): any[]; - public splice(index: number, count: number): any[]; - public splice(index: number): any[]; - public createFiltered(predicate: (x: any) => boolean): List; - public createGrouped(keySelector: (x: any) => any, dataSelector: (x: any) => any): List; - public groups: any; - public dataSource: any; - public getAt: any; - } - } - module Namespace { - var define: any; - var defineWithParent: any; - } - module Class { - function define(constructor: any, instanceMembers: any): any; - function derive(baseClass: any, constructor: any, instanceMembers: any): any; - function mix(constructor: any, mixin: any): any; - } - function xhr(options: { type?: string; url?: string; user?: string; password?: string; headers?: any; data?: any; responseType?: string; }): WinJS.Promise; - module Application { - interface IOHelper { - exists(filename: string): boolean; - readText(fileName: string, def: string): WinJS.Promise; - readText(fileName: string): WinJS.Promise; - writeText(fileName: string, text: string): WinJS.Promise; - remove(fileName: string): WinJS.Promise; - } - var local: IOHelper; - var roaming: IOHelper; - var onactivated: EventListener; - var sessionState: any; - interface ApplicationActivationEvent extends Event { - detail: any; - setPromise(p: Promise): any; - } - function addEventListener(type: string, listener: EventListener, capture?: boolean): void; - var oncheckpoint: EventListener; - function start(): void; - function stop(): void; - } - class Promise { - constructor(init: (c: any, e: any, p: any) => void); - then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; - then(success?: (value: T) => Promise, error?: (error: any) => U, progress?: (progress: any) => void): Promise; - then(success?: (value: T) => U, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; - then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; - done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; - static join: any; - static timeout: any; - } - module Navigation { - var history: any; - var canGoBack: boolean; - var canGoForward: boolean; - var location: string; - var state: any; - function addEventListener(type: string, listener: EventListener, capture: boolean): void; - function back(): void; - function forward(): void; - function navigate(location: any, initialState: any); - function navigate(location: any); - function removeEventListener(type: string, listener: EventListener, capture: boolean): void; - var onbeforenavigate: CustomEvent; - var onnavigated: CustomEvent; - var onnavigating: CustomEvent; - } - module Utilities { - function markSupportedForProcessing(obj: any): void; - enum Key { - backspace, - tab, - enter, - shift, - ctrl, - alt, - pause, - capsLock, - escape, - space, - pageUp, - pageDown, - end, - home, - leftArrow, - upArrow, - rightArrow, - downArrow, - insert, - deleteKey, - num0, - num1, - num2, - num3, - num4, - num5, - num6, - num7, - num8, - num9, - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, - q, - r, - s, - t, - u, - v, - w, - x, - y, - z, - leftWindows, - rightWindows, - numPad0, - numPad1, - numPad2, - numPad3, - numPad4, - numPad5, - numPad6, - numPad7, - numPad8, - numPad9, - multiply, - add, - subtract, - decimalPoint, - divide, - f1, - f2, - f3, - f4, - f5, - f6, - f7, - f8, - f9, - f10, - f11, - f12, - numLock, - scrollLock, - semicolon, - equal, - comma, - dash, - period, - forwardSlash, - graveAccent, - openBracket, - backSlash, - closeBracket, - singleQuote - } - } - module UI { - var process: any; - var processAll: any; - var ListLayout: any; - var GridLayout: any; - var Pages: any; - var Menu: any; - var setOptions: any; - } -} - -interface Element { - winControl: any; // TODO: This should be control? -} - diff --git a/win8.1/encyclopedia/Encyclopedia/js/typings/winrt.d.ts b/win8.1/encyclopedia/Encyclopedia/js/typings/winrt.d.ts deleted file mode 100644 index 7990c1f..0000000 --- a/win8.1/encyclopedia/Encyclopedia/js/typings/winrt.d.ts +++ /dev/null @@ -1,14644 +0,0 @@ -/* ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module Windows { - export module Foundation { - export module Collections { - export enum CollectionChange { - reset, - itemInserted, - itemRemoved, - itemChanged, - } - export interface IVectorChangedEventArgs { - collectionChange: Windows.Foundation.Collections.CollectionChange; - index: number; - } - export interface IPropertySet extends Windows.Foundation.Collections.IObservableMap, Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { - } - export class PropertySet implements Windows.Foundation.Collections.IPropertySet, Windows.Foundation.Collections.IObservableMap, Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { - size: number; - onmapchanged: any/* TODO */; - lookup(key: string): any; - hasKey(key: string): boolean; - getView(): Windows.Foundation.Collections.IMapView; - insert(key: string, value: any): boolean; - remove(key: string): void; - clear(): void; - first(): Windows.Foundation.Collections.IIterator>; - } - export interface IIterable { - first(): Windows.Foundation.Collections.IIterator; - } - export interface IIterator { - current: T; - hasCurrent: boolean; - moveNext(): boolean; - getMany(): { items: T[]; returnValue: number; }; - } - export interface IVectorView extends Windows.Foundation.Collections.IIterable { - size: number; - getAt(index: number): T; - indexOf(value: T): { index: number; returnValue: boolean; }; - getMany(startIndex: number): { items: T[]; returnValue: number; }; - - toString(): string; - toLocaleString(): string; - concat(...items: T[][]): T[]; - join(seperator: string): string; - pop(): T; - push(...items: T[]): void; - reverse(): T[]; - shift(): T; - slice(start: number): T[]; - slice(start: number, end: number): T[]; - sort(): T[]; - sort(compareFn: (a: T, b: T) => number): T[]; - splice(start: number): T[]; - splice(start: number, deleteCount: number, ...items: T[]): T[]; - unshift(...items: T[]): number; - lastIndexOf(searchElement: T): number; - lastIndexOf(searchElement: T, fromIndex: number): number; - every(callbackfn: (value: T, index: number, array: T[]) => boolean): boolean; - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: T, index: number, array: T[]) => boolean): boolean; - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: T, index: number, array: T[]) => void ): void; - forEach(callbackfn: (value: T, index: number, array: T[]) => void , thisArg: any): void; - map(callbackfn: (value: T, index: number, array: T[]) => any): any[]; - map(callbackfn: (value: T, index: number, array: T[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: T, index: number, array: T[]) => boolean): T[]; - filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg: any): T[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: T[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: T[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: T[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: T[]) => any, initialValue: any): any; - length: number; - } - export interface IVector extends Windows.Foundation.Collections.IIterable { - size: number; - getAt(index: number): T; - getView(): Windows.Foundation.Collections.IVectorView; - indexOf(value: T): { index: number; returnValue: boolean; }; - setAt(index: number, value: T): void; - insertAt(index: number, value: T): void; - removeAt(index: number): void; - append(value: T): void; - removeAtEnd(): void; - clear(): void; - getMany(startIndex: number): { items: T[]; returnValue: number; }; - replaceAll(items: T[]): void; - - toString(): string; - toLocaleString(): string; - concat(...items: T[][]): T[]; - join(seperator: string): string; - pop(): T; - push(...items: T[]): void; - reverse(): T[]; - shift(): T; - slice(start: number): T[]; - slice(start: number, end: number): T[]; - sort(): T[]; - sort(compareFn: (a: T, b: T) => number): T[]; - splice(start: number): T[]; - splice(start: number, deleteCount: number, ...items: T[]): T[]; - unshift(...items: T[]): number; - lastIndexOf(searchElement: T): number; - lastIndexOf(searchElement: T, fromIndex: number): number; - every(callbackfn: (value: T, index: number, array: T[]) => boolean): boolean; - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: T, index: number, array: T[]) => boolean): boolean; - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: T, index: number, array: T[]) => void ): void; - forEach(callbackfn: (value: T, index: number, array: T[]) => void , thisArg: any): void; - map(callbackfn: (value: T, index: number, array: T[]) => any): any[]; - map(callbackfn: (value: T, index: number, array: T[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: T, index: number, array: T[]) => boolean): T[]; - filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg: any): T[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: T[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: T[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: T[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: T[]) => any, initialValue: any): any; - length: number; - } - export interface IKeyValuePair { - key: K; - value: V; - } - export interface IMap extends Windows.Foundation.Collections.IIterable> { - size: number; - lookup(key: K): V; - hasKey(key: K): boolean; - getView(): Windows.Foundation.Collections.IMapView; - insert(key: K, value: V): boolean; - remove(key: K): void; - clear(): void; - } - export interface IMapView extends Windows.Foundation.Collections.IIterable> { - size: number; - lookup(key: K): V; - hasKey(key: K): boolean; - split(): { first: Windows.Foundation.Collections.IMapView; second: Windows.Foundation.Collections.IMapView; }; - } - export interface VectorChangedEventHandler { - (sender: Windows.Foundation.Collections.IObservableVector, event: Windows.Foundation.Collections.IVectorChangedEventArgs): void; - } - export interface IObservableVector extends Windows.Foundation.Collections.IVector, Windows.Foundation.Collections.IIterable { - onvectorchanged: any/* TODO */; - } - export interface IMapChangedEventArgs { - collectionChange: Windows.Foundation.Collections.CollectionChange; - key: K; - } - export interface MapChangedEventHandler { - (sender: Windows.Foundation.Collections.IObservableMap, event: Windows.Foundation.Collections.IMapChangedEventArgs): void; - } - export interface IObservableMap extends Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { - onmapchanged: any/* TODO */; - } - } - } -} -declare module Windows { - export module Foundation { - export interface IUriRuntimeClass { - absoluteUri: string; - displayUri: string; - domain: string; - extension: string; - fragment: string; - host: string; - password: string; - path: string; - port: number; - query: string; - queryParsed: Windows.Foundation.WwwFormUrlDecoder; - rawUri: string; - schemeName: string; - suspicious: boolean; - userName: string; - equals(pUri: Windows.Foundation.Uri): boolean; - combineUri(relativeUri: string): Windows.Foundation.Uri; - } - export class WwwFormUrlDecoder implements Windows.Foundation.IWwwFormUrlDecoderRuntimeClass, Windows.Foundation.Collections.IIterable, Windows.Foundation.Collections.IVectorView { - constructor(query: string); - size: number; - getFirstValueByName(name: string): string; - first(): Windows.Foundation.Collections.IIterator; - getAt(index: number): Windows.Foundation.IWwwFormUrlDecoderEntry; - indexOf(value: Windows.Foundation.IWwwFormUrlDecoderEntry): { index: number; returnValue: boolean; }; - getMany(startIndex: number): { items: Windows.Foundation.IWwwFormUrlDecoderEntry[]; returnValue: number; }; - toString(): string; - toLocaleString(): string; - concat(...items: Windows.Foundation.IWwwFormUrlDecoderEntry[][]): Windows.Foundation.IWwwFormUrlDecoderEntry[]; - join(seperator: string): string; - pop(): Windows.Foundation.IWwwFormUrlDecoderEntry; - push(...items: Windows.Foundation.IWwwFormUrlDecoderEntry[]): void; - reverse(): Windows.Foundation.IWwwFormUrlDecoderEntry[]; - shift(): Windows.Foundation.IWwwFormUrlDecoderEntry; - slice(start: number): Windows.Foundation.IWwwFormUrlDecoderEntry[]; - slice(start: number, end: number): Windows.Foundation.IWwwFormUrlDecoderEntry[]; - sort(): Windows.Foundation.IWwwFormUrlDecoderEntry[]; - sort(compareFn: (a: Windows.Foundation.IWwwFormUrlDecoderEntry, b: Windows.Foundation.IWwwFormUrlDecoderEntry) => number): Windows.Foundation.IWwwFormUrlDecoderEntry[]; - splice(start: number): Windows.Foundation.IWwwFormUrlDecoderEntry[]; - splice(start: number, deleteCount: number, ...items: Windows.Foundation.IWwwFormUrlDecoderEntry[]): Windows.Foundation.IWwwFormUrlDecoderEntry[]; - unshift(...items: Windows.Foundation.IWwwFormUrlDecoderEntry[]): number; - lastIndexOf(searchElement: Windows.Foundation.IWwwFormUrlDecoderEntry): number; - lastIndexOf(searchElement: Windows.Foundation.IWwwFormUrlDecoderEntry, fromIndex: number): number; - every(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => boolean): boolean; - every(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => boolean): boolean; - some(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => void ): void; - forEach(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => void , thisArg: any): void; - map(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => any): any[]; - map(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => boolean): Windows.Foundation.IWwwFormUrlDecoderEntry[]; - filter(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => boolean, thisArg: any): Windows.Foundation.IWwwFormUrlDecoderEntry[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => any, initialValue: any): any; - length: number; - } - export class Uri implements Windows.Foundation.IUriRuntimeClass, Windows.Foundation.IUriRuntimeClassWithAbsoluteCanonicalUri { - constructor(uri: string); - constructor(baseUri: string, relativeUri: string); - absoluteUri: string; - displayUri: string; - domain: string; - extension: string; - fragment: string; - host: string; - password: string; - path: string; - port: number; - query: string; - queryParsed: Windows.Foundation.WwwFormUrlDecoder; - rawUri: string; - schemeName: string; - suspicious: boolean; - userName: string; - absoluteCanonicalUri: string; - displayIri: string; - equals(pUri: Windows.Foundation.Uri): boolean; - combineUri(relativeUri: string): Windows.Foundation.Uri; - static unescapeComponent(toUnescape: string): string; - static escapeComponent(toEscape: string): string; - } - export interface IUriRuntimeClassWithAbsoluteCanonicalUri { - absoluteCanonicalUri: string; - displayIri: string; - } - export interface IUriEscapeStatics { - unescapeComponent(toUnescape: string): string; - escapeComponent(toEscape: string): string; - } - export interface IUriRuntimeClassFactory { - createUri(uri: string): Windows.Foundation.Uri; - createUri(baseUri: string, relativeUri: string): Windows.Foundation.Uri; - } - export interface IWwwFormUrlDecoderEntry { - name: string; - value: string; - } - export interface IWwwFormUrlDecoderRuntimeClass extends Windows.Foundation.Collections.IIterable, Windows.Foundation.Collections.IVectorView { - getFirstValueByName(name: string): string; - } - export interface IWwwFormUrlDecoderRuntimeClassFactory { - createWwwFormUrlDecoder(query: string): Windows.Foundation.WwwFormUrlDecoder; - } - export interface IGetActivationFactory { - getActivationFactory(activatableClassId: string): any; - } - export interface IClosable { - close(): void; - } - export enum PropertyType { - empty, - uInt8, - int16, - uInt16, - int32, - uInt32, - int64, - uInt64, - single, - double, - char16, - boolean, - string, - inspectable, - dateTime, - timeSpan, - guid, - point, - size, - rect, - otherType, - uInt8Array, - int16Array, - uInt16Array, - int32Array, - uInt32Array, - int64Array, - uInt64Array, - singleArray, - doubleArray, - char16Array, - booleanArray, - stringArray, - inspectableArray, - dateTimeArray, - timeSpanArray, - guidArray, - pointArray, - sizeArray, - rectArray, - otherTypeArray, - } - export interface Point { - x: number; - y: number; - } - export interface Size { - width: number; - height: number; - } - export interface Rect { - x: number; - y: number; - width: number; - height: number; - } - export interface DateTime { - universalTime: number; - } - export interface TimeSpan { - duration: number; - } - export interface IPropertyValue { - isNumericScalar: boolean; - type: Windows.Foundation.PropertyType; - getUInt8(): number; - getInt16(): number; - getUInt16(): number; - getInt32(): number; - getUInt32(): number; - getInt64(): number; - getUInt64(): number; - getSingle(): number; - getDouble(): number; - getChar16(): string; - getBoolean(): boolean; - getString(): string; - getGuid(): string; - getDateTime(): Date; - getTimeSpan(): number; - getPoint(): Windows.Foundation.Point; - getSize(): Windows.Foundation.Size; - getRect(): Windows.Foundation.Rect; - getUInt8Array(): Uint8Array; - getInt16Array(): Int16Array; - getUInt16Array(): Uint16Array; - getInt32Array(): Int32Array; - getUInt32Array(): Uint32Array; - getInt64Array(): number[]; - getUInt64Array(): number[]; - getSingleArray(): Float32Array; - getDoubleArray(): Float64Array; - getChar16Array(): string[]; - getBooleanArray(): boolean[]; - getStringArray(): string[]; - getInspectableArray(): any[]; - getGuidArray(): string[]; - getDateTimeArray(): Date[]; - getTimeSpanArray(): number[]; - getPointArray(): Windows.Foundation.Point[]; - getSizeArray(): Windows.Foundation.Size[]; - getRectArray(): Windows.Foundation.Rect[]; - } - export interface IPropertyValueStatics { - createEmpty(): any; - createUInt8(value: number): any; - createInt16(value: number): any; - createUInt16(value: number): any; - createInt32(value: number): any; - createUInt32(value: number): any; - createInt64(value: number): any; - createUInt64(value: number): any; - createSingle(value: number): any; - createDouble(value: number): any; - createChar16(value: string): any; - createBoolean(value: boolean): any; - createString(value: string): any; - createInspectable(value: any): any; - createGuid(value: string): any; - createDateTime(value: Date): any; - createTimeSpan(value: number): any; - createPoint(value: Windows.Foundation.Point): any; - createSize(value: Windows.Foundation.Size): any; - createRect(value: Windows.Foundation.Rect): any; - createUInt8Array(value: Uint8Array): any; - createInt16Array(value: Int16Array): any; - createUInt16Array(value: Uint16Array): any; - createInt32Array(value: Int32Array): any; - createUInt32Array(value: Uint32Array): any; - createInt64Array(value: number[]): any; - createUInt64Array(value: number[]): any; - createSingleArray(value: Float32Array): any; - createDoubleArray(value: Float64Array): any; - createChar16Array(value: string[]): any; - createBooleanArray(value: boolean[]): any; - createStringArray(value: string[]): any; - createInspectableArray(value: any[]): any; - createGuidArray(value: string[]): any; - createDateTimeArray(value: Date[]): any; - createTimeSpanArray(value: number[]): any; - createPointArray(value: Windows.Foundation.Point[]): any; - createSizeArray(value: Windows.Foundation.Size[]): any; - createRectArray(value: Windows.Foundation.Rect[]): any; - } - export class PropertyValue { - static createEmpty(): any; - static createUInt8(value: number): any; - static createInt16(value: number): any; - static createUInt16(value: number): any; - static createInt32(value: number): any; - static createUInt32(value: number): any; - static createInt64(value: number): any; - static createUInt64(value: number): any; - static createSingle(value: number): any; - static createDouble(value: number): any; - static createChar16(value: string): any; - static createBoolean(value: boolean): any; - static createString(value: string): any; - static createInspectable(value: any): any; - static createGuid(value: string): any; - static createDateTime(value: Date): any; - static createTimeSpan(value: number): any; - static createPoint(value: Windows.Foundation.Point): any; - static createSize(value: Windows.Foundation.Size): any; - static createRect(value: Windows.Foundation.Rect): any; - static createUInt8Array(value: Uint8Array): any; - static createInt16Array(value: Int16Array): any; - static createUInt16Array(value: Uint16Array): any; - static createInt32Array(value: Int32Array): any; - static createUInt32Array(value: Uint32Array): any; - static createInt64Array(value: number[]): any; - static createUInt64Array(value: number[]): any; - static createSingleArray(value: Float32Array): any; - static createDoubleArray(value: Float64Array): any; - static createChar16Array(value: string[]): any; - static createBooleanArray(value: boolean[]): any; - static createStringArray(value: string[]): any; - static createInspectableArray(value: any[]): any; - static createGuidArray(value: string[]): any; - static createDateTimeArray(value: Date[]): any; - static createTimeSpanArray(value: number[]): any; - static createPointArray(value: Windows.Foundation.Point[]): any; - static createSizeArray(value: Windows.Foundation.Size[]): any; - static createRectArray(value: Windows.Foundation.Rect[]): any; - } - export interface AsyncActionCompletedHandler { - (asyncInfo: Windows.Foundation.IAsyncAction, asyncStatus: Windows.Foundation.AsyncStatus): void; - } - export enum AsyncStatus { - canceled, - completed, - error, - started, - } - export interface EventRegistrationToken { - value: number; - } - export interface HResult { - value: number; - } - export interface IAsyncInfo { - errorCode: number; - id: number; - status: Windows.Foundation.AsyncStatus; - cancel(): void; - close(): void; - } - export interface IAsyncAction extends Windows.Foundation.IAsyncInfo { - completed: Windows.Foundation.AsyncActionCompletedHandler; - getResults(): void; - } - export interface AsyncOperationWithProgressCompletedHandler { - (asyncInfo: Windows.Foundation.IAsyncOperationWithProgress, asyncStatus: Windows.Foundation.AsyncStatus): void; - } - export interface IAsyncOperationWithProgress extends Windows.Foundation.IPromise { - operation: { - progress: Windows.Foundation.AsyncOperationProgressHandler; - completed: Windows.Foundation.AsyncOperationWithProgressCompletedHandler; - getResults(): TResult; - } - } - export interface AsyncOperationCompletedHandler { - (asyncInfo: Windows.Foundation.IAsyncOperation, asyncStatus: Windows.Foundation.AsyncStatus): void; - } - export interface IAsyncOperation extends Windows.Foundation.IPromise { - operation: { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - getResults(): TResult; - } - } - export interface AsyncActionWithProgressCompletedHandler { - (asyncInfo: Windows.Foundation.IAsyncActionWithProgress, asyncStatus: Windows.Foundation.AsyncStatus): void; - } - export interface IAsyncActionWithProgress extends Windows.Foundation.IAsyncInfo { - progress: Windows.Foundation.AsyncActionProgressHandler; - completed: Windows.Foundation.AsyncActionWithProgressCompletedHandler; - getResults(): void; - } - export interface AsyncOperationProgressHandler { - (asyncInfo: Windows.Foundation.IAsyncOperationWithProgress, progressInfo: TProgress): void; - } - export interface AsyncActionProgressHandler { - (asyncInfo: Windows.Foundation.IAsyncActionWithProgress, progressInfo: TProgress): void; - } - export interface IReference extends Windows.Foundation.IPropertyValue { - value: T; - } - export interface IReferenceArray extends Windows.Foundation.IPropertyValue { - value: T[]; - } - export interface TypedEventHandler { - (sender: TSender, args: TResult): void; - } - export interface EventHandler { - (sender: any, args: T): void; - } - } -} -declare module Windows { - export module Foundation { - export module Metadata { - export class WebHostHiddenAttribute { - } - export class VariantAttribute { - } - export class HasVariantAttribute { - } - export class DualApiPartitionAttribute { - } - export class MuseAttribute { - } - export enum GCPressureAmount { - low, - medium, - high, - } - export class GCPressureAttribute { - } - export class ActivatableAttribute { - constructor(version: number); - constructor(type: string /* TODO: really? */, version: number); - } - export class VersionAttribute { - constructor(version: number); - } - export class AllowMultipleAttribute { - } - export class AttributeUsageAttribute { - constructor(targets: Windows.Foundation.Metadata.AttributeTargets /* TODO: Really part of WinRT? */); - } - export enum AttributeTargets { - all, - delegate, - enum, - event, - field, - interface, - method, - parameter, - property, - runtimeClass, - struct, - interfaceImpl, - } - export class DefaultOverloadAttribute { - } - export class DefaultAttribute { - } - export class GuidAttribute { - constructor(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number); - } - export class ComposableAttribute { - constructor(type: string /* TODO: really? */, compositionType: Windows.Foundation.Metadata.CompositionType, version: number); - } - export enum CompositionType { - protected, - public, - } - export class OverloadAttribute { - constructor(method: string); - } - export class StaticAttribute { - constructor(type: string /* TODO: really? */, version: number); - } - export class OverridableAttribute { - } - export class ProtectedAttribute { - } - export class ThreadingAttribute { - constructor(model: Windows.Foundation.Metadata.ThreadingModel); - } - export enum ThreadingModel { - sTA, - mTA, - both, - invalidThreading, - } - export class MarshalingBehaviorAttribute { - constructor(behavior: Windows.Foundation.Metadata.MarshalingType); - } - export enum MarshalingType { - none, - agile, - standard, - invalidMarshaling, - } - export class ExclusiveToAttribute { - constructor(typeName: string /* TODO: really? */); - } - export class LengthIsAttribute { - constructor(indexLengthParameter: number); - } - export class RangeAttribute { - constructor(minValue: number, maxValue: number); - } - } - } -} -declare module Windows { - export module Foundation { - export module Diagnostics { - export enum ErrorOptions { - none, - suppressExceptions, - forceExceptions, - useSetErrorInfo, - suppressSetErrorInfo, - } - export interface IErrorReportingSettings { - setErrorOptions(value: Windows.Foundation.Diagnostics.ErrorOptions): void; - getErrorOptions(): Windows.Foundation.Diagnostics.ErrorOptions; - } - export class RuntimeBrokerErrorSettings implements Windows.Foundation.Diagnostics.IErrorReportingSettings { - setErrorOptions(value: Windows.Foundation.Diagnostics.ErrorOptions): void; - getErrorOptions(): Windows.Foundation.Diagnostics.ErrorOptions; - } - } - } -} -declare module Windows { - export module ApplicationModel { - export module Background { - export enum BackgroundAccessStatus { - unspecified, - allowedWithAlwaysOnRealTimeConnectivity, - allowedMayUseActiveRealTimeConnectivity, - denied, - } - export interface IBackgroundExecutionManagerStatics { - requestAccessAsync(): Windows.Foundation.IAsyncOperation; - requestAccessAsync(applicationId: string): Windows.Foundation.IAsyncOperation; - removeAccess(): void; - removeAccess(applicationId: string): void; - getAccessStatus(): Windows.ApplicationModel.Background.BackgroundAccessStatus; - getAccessStatus(applicationId: string): Windows.ApplicationModel.Background.BackgroundAccessStatus; - } - export class BackgroundExecutionManager { - static requestAccessAsync(): Windows.Foundation.IAsyncOperation; - static requestAccessAsync(applicationId: string): Windows.Foundation.IAsyncOperation; - static removeAccess(): void; - static removeAccess(applicationId: string): void; - static getAccessStatus(): Windows.ApplicationModel.Background.BackgroundAccessStatus; - static getAccessStatus(applicationId: string): Windows.ApplicationModel.Background.BackgroundAccessStatus; - } - export enum BackgroundTaskCancellationReason { - abort, - terminating, - loggingOff, - servicingUpdate, - } - export interface BackgroundTaskCanceledEventHandler { - (sender: Windows.ApplicationModel.Background.IBackgroundTaskInstance, reason: Windows.ApplicationModel.Background.BackgroundTaskCancellationReason): void; - } - export interface IBackgroundTaskInstance { - instanceId: string; - progress: number; - suspendedCount: number; - task: Windows.ApplicationModel.Background.BackgroundTaskRegistration; - triggerDetails: any; - oncanceled: any/* TODO */; - getDeferral(): Windows.ApplicationModel.Background.BackgroundTaskDeferral; - } - export class BackgroundTaskRegistration implements Windows.ApplicationModel.Background.IBackgroundTaskRegistration { - name: string; - taskId: string; - onprogress: any/* TODO */; - oncompleted: any/* TODO */; - unregister(cancelTask: boolean): void; - static allTasks: Windows.Foundation.Collections.IMapView; - } - export class BackgroundTaskDeferral implements Windows.ApplicationModel.Background.IBackgroundTaskDeferral { - complete(): void; - } - export interface BackgroundTaskProgressEventHandler { - (sender: Windows.ApplicationModel.Background.BackgroundTaskRegistration, args: Windows.ApplicationModel.Background.BackgroundTaskProgressEventArgs): void; - } - export class BackgroundTaskProgressEventArgs implements Windows.ApplicationModel.Background.IBackgroundTaskProgressEventArgs { - instanceId: string; - progress: number; - } - export interface BackgroundTaskCompletedEventHandler { - (sender: Windows.ApplicationModel.Background.BackgroundTaskRegistration, args: Windows.ApplicationModel.Background.BackgroundTaskCompletedEventArgs): void; - } - export class BackgroundTaskCompletedEventArgs implements Windows.ApplicationModel.Background.IBackgroundTaskCompletedEventArgs { - instanceId: string; - checkResult(): void; - } - export interface IBackgroundTaskDeferral { - complete(): void; - } - export interface IBackgroundTask { - run(taskInstance: Windows.ApplicationModel.Background.IBackgroundTaskInstance): void; - } - export interface IBackgroundTaskRegistration { - name: string; - taskId: string; - onprogress: any/* TODO */; - oncompleted: any/* TODO */; - unregister(cancelTask: boolean): void; - } - export interface IBackgroundTaskRegistrationStatics { - allTasks: Windows.Foundation.Collections.IMapView; - } - export interface IBackgroundTaskBuilder { - name: string; - taskEntryPoint: string; - setTrigger(trigger: Windows.ApplicationModel.Background.IBackgroundTrigger): void; - addCondition(condition: Windows.ApplicationModel.Background.IBackgroundCondition): void; - register(): Windows.ApplicationModel.Background.BackgroundTaskRegistration; - } - export interface IBackgroundTrigger { - } - export interface IBackgroundCondition { - } - export interface IBackgroundTaskCompletedEventArgs { - instanceId: string; - checkResult(): void; - } - export interface IBackgroundTaskProgressEventArgs { - instanceId: string; - progress: number; - } - export class BackgroundTaskBuilder implements Windows.ApplicationModel.Background.IBackgroundTaskBuilder { - name: string; - taskEntryPoint: string; - setTrigger(trigger: Windows.ApplicationModel.Background.IBackgroundTrigger): void; - addCondition(condition: Windows.ApplicationModel.Background.IBackgroundCondition): void; - register(): Windows.ApplicationModel.Background.BackgroundTaskRegistration; - } - export enum SystemTriggerType { - invalid, - smsReceived, - userPresent, - userAway, - networkStateChange, - controlChannelReset, - internetAvailable, - sessionConnected, - servicingComplete, - lockScreenApplicationAdded, - lockScreenApplicationRemoved, - timeZoneChange, - onlineIdConnectedStateChange, - } - export enum SystemConditionType { - invalid, - userPresent, - userNotPresent, - internetAvailable, - internetNotAvailable, - sessionConnected, - sessionDisconnected, - } - export interface ISystemTrigger extends Windows.ApplicationModel.Background.IBackgroundTrigger { - oneShot: boolean; - triggerType: Windows.ApplicationModel.Background.SystemTriggerType; - } - export interface ISystemTriggerFactory { - create(triggerType: Windows.ApplicationModel.Background.SystemTriggerType, oneShot: boolean): Windows.ApplicationModel.Background.SystemTrigger; - } - export class SystemTrigger implements Windows.ApplicationModel.Background.ISystemTrigger, Windows.ApplicationModel.Background.IBackgroundTrigger { - constructor(triggerType: Windows.ApplicationModel.Background.SystemTriggerType, oneShot: boolean); - oneShot: boolean; - triggerType: Windows.ApplicationModel.Background.SystemTriggerType; - } - export interface ISystemCondition extends Windows.ApplicationModel.Background.IBackgroundCondition { - conditionType: Windows.ApplicationModel.Background.SystemConditionType; - } - export interface ISystemConditionFactory { - create(conditionType: Windows.ApplicationModel.Background.SystemConditionType): Windows.ApplicationModel.Background.SystemCondition; - } - export class SystemCondition implements Windows.ApplicationModel.Background.ISystemCondition, Windows.ApplicationModel.Background.IBackgroundCondition { - constructor(conditionType: Windows.ApplicationModel.Background.SystemConditionType); - conditionType: Windows.ApplicationModel.Background.SystemConditionType; - } - export interface INetworkOperatorNotificationTrigger extends Windows.ApplicationModel.Background.IBackgroundTrigger { - networkAccountId: string; - } - export interface INetworkOperatorNotificationTriggerFactory { - create(networkAccountId: string): Windows.ApplicationModel.Background.NetworkOperatorNotificationTrigger; - } - export class NetworkOperatorNotificationTrigger implements Windows.ApplicationModel.Background.INetworkOperatorNotificationTrigger, Windows.ApplicationModel.Background.IBackgroundTrigger { - constructor(networkAccountId: string); - networkAccountId: string; - } - export interface ITimeTrigger extends Windows.ApplicationModel.Background.IBackgroundTrigger { - freshnessTime: number; - oneShot: boolean; - } - export interface ITimeTriggerFactory { - create(freshnessTime: number, oneShot: boolean): Windows.ApplicationModel.Background.TimeTrigger; - } - export class TimeTrigger implements Windows.ApplicationModel.Background.ITimeTrigger, Windows.ApplicationModel.Background.IBackgroundTrigger { - constructor(freshnessTime: number, oneShot: boolean); - freshnessTime: number; - oneShot: boolean; - } - export interface IMaintenanceTrigger extends Windows.ApplicationModel.Background.IBackgroundTrigger { - freshnessTime: number; - oneShot: boolean; - } - export interface IMaintenanceTriggerFactory { - create(freshnessTime: number, oneShot: boolean): Windows.ApplicationModel.Background.MaintenanceTrigger; - } - export class MaintenanceTrigger implements Windows.ApplicationModel.Background.IMaintenanceTrigger, Windows.ApplicationModel.Background.IBackgroundTrigger { - constructor(freshnessTime: number, oneShot: boolean); - freshnessTime: number; - oneShot: boolean; - } - export interface INetworkOperatorHotspotAuthenticationTrigger extends Windows.ApplicationModel.Background.IBackgroundTrigger { - } - export class NetworkOperatorHotspotAuthenticationTrigger implements Windows.ApplicationModel.Background.INetworkOperatorHotspotAuthenticationTrigger, Windows.ApplicationModel.Background.IBackgroundTrigger { - } - export interface IPushNotificationTriggerFactory { - create(applicationId: string): Windows.ApplicationModel.Background.PushNotificationTrigger; - } - export class PushNotificationTrigger implements Windows.ApplicationModel.Background.IBackgroundTrigger { - constructor(applicationId: string); - constructor(); - } - } - } -} -declare module Windows { - export module ApplicationModel { - export module Contacts { - export enum ContactFieldType { - email, - phoneNumber, - location, - instantMessage, - custom, - } - export enum ContactFieldCategory { - none, - home, - work, - mobile, - other, - } - export enum ContactSelectionMode { - contacts, - fields, - } - export interface IContactField { - category: Windows.ApplicationModel.Contacts.ContactFieldCategory; - name: string; - type: Windows.ApplicationModel.Contacts.ContactFieldType; - value: string; - } - export class ContactField implements Windows.ApplicationModel.Contacts.IContactField { - constructor(value: string, type: Windows.ApplicationModel.Contacts.ContactFieldType); - constructor(value: string, type: Windows.ApplicationModel.Contacts.ContactFieldType, category: Windows.ApplicationModel.Contacts.ContactFieldCategory); - constructor(name: string, value: string, type: Windows.ApplicationModel.Contacts.ContactFieldType, category: Windows.ApplicationModel.Contacts.ContactFieldCategory); - category: Windows.ApplicationModel.Contacts.ContactFieldCategory; - name: string; - type: Windows.ApplicationModel.Contacts.ContactFieldType; - value: string; - } - export interface IContactLocationField extends Windows.ApplicationModel.Contacts.IContactField { - city: string; - country: string; - postalCode: string; - region: string; - street: string; - unstructuredAddress: string; - } - export class ContactLocationField implements Windows.ApplicationModel.Contacts.IContactLocationField, Windows.ApplicationModel.Contacts.IContactField { - constructor(unstructuredAddress: string); - constructor(unstructuredAddress: string, category: Windows.ApplicationModel.Contacts.ContactFieldCategory); - constructor(unstructuredAddress: string, category: Windows.ApplicationModel.Contacts.ContactFieldCategory, street: string, city: string, region: string, country: string, postalCode: string); - city: string; - country: string; - postalCode: string; - region: string; - street: string; - unstructuredAddress: string; - category: Windows.ApplicationModel.Contacts.ContactFieldCategory; - name: string; - type: Windows.ApplicationModel.Contacts.ContactFieldType; - value: string; - } - export interface IContactInstantMessageField extends Windows.ApplicationModel.Contacts.IContactField { - displayText: string; - launchUri: Windows.Foundation.Uri; - service: string; - userName: string; - } - export class ContactInstantMessageField implements Windows.ApplicationModel.Contacts.IContactInstantMessageField, Windows.ApplicationModel.Contacts.IContactField { - constructor(userName: string); - constructor(userName: string, category: Windows.ApplicationModel.Contacts.ContactFieldCategory); - constructor(userName: string, category: Windows.ApplicationModel.Contacts.ContactFieldCategory, service: string, displayText: string, verb: Windows.Foundation.Uri); - displayText: string; - launchUri: Windows.Foundation.Uri; - service: string; - userName: string; - category: Windows.ApplicationModel.Contacts.ContactFieldCategory; - name: string; - type: Windows.ApplicationModel.Contacts.ContactFieldType; - value: string; - } - export interface IKnownContactFieldStatics { - email: string; - instantMessage: string; - location: string; - phoneNumber: string; - convertNameToType(name: string): Windows.ApplicationModel.Contacts.ContactFieldType; - convertTypeToName(type: Windows.ApplicationModel.Contacts.ContactFieldType): string; - } - export class KnownContactField { - static email: string; - static instantMessage: string; - static location: string; - static phoneNumber: string; - static convertNameToType(name: string): Windows.ApplicationModel.Contacts.ContactFieldType; - static convertTypeToName(type: Windows.ApplicationModel.Contacts.ContactFieldType): string; - } - export interface IContactInformation { - customFields: Windows.Foundation.Collections.IVectorView; - emails: Windows.Foundation.Collections.IVectorView; - instantMessages: Windows.Foundation.Collections.IVectorView; - locations: Windows.Foundation.Collections.IVectorView; - name: string; - phoneNumbers: Windows.Foundation.Collections.IVectorView; - getThumbnailAsync(): Windows.Foundation.IAsyncOperation; - queryCustomFields(customName: string): Windows.Foundation.Collections.IVectorView; - } - export class ContactInformation implements Windows.ApplicationModel.Contacts.IContactInformation { - customFields: Windows.Foundation.Collections.IVectorView; - emails: Windows.Foundation.Collections.IVectorView; - instantMessages: Windows.Foundation.Collections.IVectorView; - locations: Windows.Foundation.Collections.IVectorView; - name: string; - phoneNumbers: Windows.Foundation.Collections.IVectorView; - getThumbnailAsync(): Windows.Foundation.IAsyncOperation; - queryCustomFields(customName: string): Windows.Foundation.Collections.IVectorView; - } - export interface IContactPicker { - commitButtonText: string; - desiredFields: Windows.Foundation.Collections.IVector; - selectionMode: Windows.ApplicationModel.Contacts.ContactSelectionMode; - pickSingleContactAsync(): Windows.Foundation.IAsyncOperation; - pickMultipleContactsAsync(): Windows.Foundation.IAsyncOperation>; - } - export class ContactPicker implements Windows.ApplicationModel.Contacts.IContactPicker { - commitButtonText: string; - desiredFields: Windows.Foundation.Collections.IVector; - selectionMode: Windows.ApplicationModel.Contacts.ContactSelectionMode; - pickSingleContactAsync(): Windows.Foundation.IAsyncOperation; - pickMultipleContactsAsync(): Windows.Foundation.IAsyncOperation>; - } - export interface IContact { - fields: Windows.Foundation.Collections.IVector; - name: string; - thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; - } - export class Contact implements Windows.ApplicationModel.Contacts.IContact { - fields: Windows.Foundation.Collections.IVector; - name: string; - thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; - } - export interface IContactFieldFactory { - createField(value: string, type: Windows.ApplicationModel.Contacts.ContactFieldType): Windows.ApplicationModel.Contacts.ContactField; - createField(value: string, type: Windows.ApplicationModel.Contacts.ContactFieldType, category: Windows.ApplicationModel.Contacts.ContactFieldCategory): Windows.ApplicationModel.Contacts.ContactField; - createField(name: string, value: string, type: Windows.ApplicationModel.Contacts.ContactFieldType, category: Windows.ApplicationModel.Contacts.ContactFieldCategory): Windows.ApplicationModel.Contacts.ContactField; - } - export interface IContactLocationFieldFactory { - createLocation(unstructuredAddress: string): Windows.ApplicationModel.Contacts.ContactLocationField; - createLocation(unstructuredAddress: string, category: Windows.ApplicationModel.Contacts.ContactFieldCategory): Windows.ApplicationModel.Contacts.ContactLocationField; - createLocation(unstructuredAddress: string, category: Windows.ApplicationModel.Contacts.ContactFieldCategory, street: string, city: string, region: string, country: string, postalCode: string): Windows.ApplicationModel.Contacts.ContactLocationField; - } - export interface IContactInstantMessageFieldFactory { - createInstantMessage(userName: string): Windows.ApplicationModel.Contacts.ContactInstantMessageField; - createInstantMessage(userName: string, category: Windows.ApplicationModel.Contacts.ContactFieldCategory): Windows.ApplicationModel.Contacts.ContactInstantMessageField; - createInstantMessage(userName: string, category: Windows.ApplicationModel.Contacts.ContactFieldCategory, service: string, displayText: string, verb: Windows.Foundation.Uri): Windows.ApplicationModel.Contacts.ContactInstantMessageField; - } - export class ContactFieldFactory implements Windows.ApplicationModel.Contacts.IContactFieldFactory, Windows.ApplicationModel.Contacts.IContactLocationFieldFactory, Windows.ApplicationModel.Contacts.IContactInstantMessageFieldFactory { - createField(value: string, type: Windows.ApplicationModel.Contacts.ContactFieldType): Windows.ApplicationModel.Contacts.ContactField; - createField(value: string, type: Windows.ApplicationModel.Contacts.ContactFieldType, category: Windows.ApplicationModel.Contacts.ContactFieldCategory): Windows.ApplicationModel.Contacts.ContactField; - createField(name: string, value: string, type: Windows.ApplicationModel.Contacts.ContactFieldType, category: Windows.ApplicationModel.Contacts.ContactFieldCategory): Windows.ApplicationModel.Contacts.ContactField; - createLocation(unstructuredAddress: string): Windows.ApplicationModel.Contacts.ContactLocationField; - createLocation(unstructuredAddress: string, category: Windows.ApplicationModel.Contacts.ContactFieldCategory): Windows.ApplicationModel.Contacts.ContactLocationField; - createLocation(unstructuredAddress: string, category: Windows.ApplicationModel.Contacts.ContactFieldCategory, street: string, city: string, region: string, country: string, postalCode: string): Windows.ApplicationModel.Contacts.ContactLocationField; - createInstantMessage(userName: string): Windows.ApplicationModel.Contacts.ContactInstantMessageField; - createInstantMessage(userName: string, category: Windows.ApplicationModel.Contacts.ContactFieldCategory): Windows.ApplicationModel.Contacts.ContactInstantMessageField; - createInstantMessage(userName: string, category: Windows.ApplicationModel.Contacts.ContactFieldCategory, service: string, displayText: string, verb: Windows.Foundation.Uri): Windows.ApplicationModel.Contacts.ContactInstantMessageField; - } - } - } -} -declare module Windows { - export module ApplicationModel { - export module Contacts { - export module Provider { - export interface IContactRemovedEventArgs { - id: string; - } - export class ContactRemovedEventArgs implements Windows.ApplicationModel.Contacts.Provider.IContactRemovedEventArgs { - id: string; - } - export enum AddContactResult { - added, - alreadyAdded, - unavailable, - } - export interface IContactPickerUI { - desiredFields: Windows.Foundation.Collections.IVectorView; - selectionMode: Windows.ApplicationModel.Contacts.ContactSelectionMode; - addContact(id: string, contact: Windows.ApplicationModel.Contacts.Contact): Windows.ApplicationModel.Contacts.Provider.AddContactResult; - removeContact(id: string): void; - containsContact(id: string): boolean; - oncontactremoved: any/* TODO */; - } - export class ContactPickerUI implements Windows.ApplicationModel.Contacts.Provider.IContactPickerUI { - desiredFields: Windows.Foundation.Collections.IVectorView; - selectionMode: Windows.ApplicationModel.Contacts.ContactSelectionMode; - addContact(id: string, contact: Windows.ApplicationModel.Contacts.Contact): Windows.ApplicationModel.Contacts.Provider.AddContactResult; - removeContact(id: string): void; - containsContact(id: string): boolean; - oncontactremoved: any/* TODO */; - } - } - } - } -} -declare module Windows { - export module ApplicationModel { - export module DataTransfer { - export interface IStandardDataFormatsStatics { - bitmap: string; - html: string; - rtf: string; - storageItems: string; - text: string; - uri: string; - } - export class StandardDataFormats { - static bitmap: string; - static html: string; - static rtf: string; - static storageItems: string; - static text: string; - static uri: string; - } - export interface IDataPackagePropertySetView extends Windows.Foundation.Collections.IMapView, Windows.Foundation.Collections.IIterable> { - applicationListingUri: Windows.Foundation.Uri; - applicationName: string; - description: string; - fileTypes: Windows.Foundation.Collections.IVectorView; - thumbnail: Windows.Storage.Streams.RandomAccessStreamReference; - title: string; - } - export interface IDataPackagePropertySet extends Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { - applicationListingUri: Windows.Foundation.Uri; - applicationName: string; - description: string; - fileTypes: Windows.Foundation.Collections.IVector; - thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; - title: string; - } - export class DataPackagePropertySetView implements Windows.ApplicationModel.DataTransfer.IDataPackagePropertySetView, Windows.Foundation.Collections.IMapView, Windows.Foundation.Collections.IIterable> { - applicationListingUri: Windows.Foundation.Uri; - applicationName: string; - description: string; - fileTypes: Windows.Foundation.Collections.IVectorView; - thumbnail: Windows.Storage.Streams.RandomAccessStreamReference; - title: string; - size: number; - lookup(key: string): any; - hasKey(key: string): boolean; - split(): { first: Windows.Foundation.Collections.IMapView; second: Windows.Foundation.Collections.IMapView; }; - first(): Windows.Foundation.Collections.IIterator>; - } - export class DataPackagePropertySet implements Windows.ApplicationModel.DataTransfer.IDataPackagePropertySet, Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { - applicationListingUri: Windows.Foundation.Uri; - applicationName: string; - description: string; - fileTypes: Windows.Foundation.Collections.IVector; - thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; - title: string; - size: number; - lookup(key: string): any; - hasKey(key: string): boolean; - getView(): Windows.Foundation.Collections.IMapView; - insert(key: string, value: any): boolean; - remove(key: string): void; - clear(): void; - first(): Windows.Foundation.Collections.IIterator>; - } - export interface IDataProviderDeferral { - complete(): void; - } - export class DataProviderDeferral implements Windows.ApplicationModel.DataTransfer.IDataProviderDeferral { - complete(): void; - } - export interface IDataProviderRequest { - deadline: Date; - formatId: string; - getDeferral(): Windows.ApplicationModel.DataTransfer.DataProviderDeferral; - setData(value: any): void; - } - export class DataProviderRequest implements Windows.ApplicationModel.DataTransfer.IDataProviderRequest { - deadline: Date; - formatId: string; - getDeferral(): Windows.ApplicationModel.DataTransfer.DataProviderDeferral; - setData(value: any): void; - } - export interface DataProviderHandler { - (request: Windows.ApplicationModel.DataTransfer.DataProviderRequest): void; - } - export enum DataPackageOperation { - none, - copy, - move, - link, - } - export interface IOperationCompletedEventArgs { - operation: Windows.ApplicationModel.DataTransfer.DataPackageOperation; - } - export class OperationCompletedEventArgs implements Windows.ApplicationModel.DataTransfer.IOperationCompletedEventArgs { - operation: Windows.ApplicationModel.DataTransfer.DataPackageOperation; - } - export interface IDataPackageView { - availableFormats: Windows.Foundation.Collections.IVectorView; - properties: Windows.ApplicationModel.DataTransfer.DataPackagePropertySetView; - requestedOperation: Windows.ApplicationModel.DataTransfer.DataPackageOperation; - reportOperationCompleted(value: Windows.ApplicationModel.DataTransfer.DataPackageOperation): void; - contains(formatId: string): boolean; - getDataAsync(formatId: string): Windows.Foundation.IAsyncOperation; - getTextAsync(): Windows.Foundation.IAsyncOperation; - getTextAsync(formatId: string): Windows.Foundation.IAsyncOperation; - getUriAsync(): Windows.Foundation.IAsyncOperation; - getHtmlFormatAsync(): Windows.Foundation.IAsyncOperation; - getResourceMapAsync(): Windows.Foundation.IAsyncOperation>; - getRtfAsync(): Windows.Foundation.IAsyncOperation; - getBitmapAsync(): Windows.Foundation.IAsyncOperation; - getStorageItemsAsync(): Windows.Foundation.IAsyncOperation>; - } - export interface IDataPackage { - properties: Windows.ApplicationModel.DataTransfer.DataPackagePropertySet; - requestedOperation: Windows.ApplicationModel.DataTransfer.DataPackageOperation; - resourceMap: Windows.Foundation.Collections.IMap; - getView(): Windows.ApplicationModel.DataTransfer.DataPackageView; - onoperationcompleted: any/* TODO */; - ondestroyed: any/* TODO */; - setData(formatId: string, value: any): void; - setDataProvider(formatId: string, delayRenderer: Windows.ApplicationModel.DataTransfer.DataProviderHandler): void; - setText(value: string): void; - setUri(value: Windows.Foundation.Uri): void; - setHtmlFormat(value: string): void; - setRtf(value: string): void; - setBitmap(value: Windows.Storage.Streams.RandomAccessStreamReference): void; - setStorageItems(value: Windows.Foundation.Collections.IIterable): void; - setStorageItems(value: Windows.Foundation.Collections.IIterable, readOnly: boolean): void; - } - export class DataPackageView implements Windows.ApplicationModel.DataTransfer.IDataPackageView { - availableFormats: Windows.Foundation.Collections.IVectorView; - properties: Windows.ApplicationModel.DataTransfer.DataPackagePropertySetView; - requestedOperation: Windows.ApplicationModel.DataTransfer.DataPackageOperation; - reportOperationCompleted(value: Windows.ApplicationModel.DataTransfer.DataPackageOperation): void; - contains(formatId: string): boolean; - getDataAsync(formatId: string): Windows.Foundation.IAsyncOperation; - getTextAsync(): Windows.Foundation.IAsyncOperation; - getTextAsync(formatId: string): Windows.Foundation.IAsyncOperation; - getUriAsync(): Windows.Foundation.IAsyncOperation; - getHtmlFormatAsync(): Windows.Foundation.IAsyncOperation; - getResourceMapAsync(): Windows.Foundation.IAsyncOperation>; - getRtfAsync(): Windows.Foundation.IAsyncOperation; - getBitmapAsync(): Windows.Foundation.IAsyncOperation; - getStorageItemsAsync(): Windows.Foundation.IAsyncOperation>; - } - export class DataPackage implements Windows.ApplicationModel.DataTransfer.IDataPackage { - properties: Windows.ApplicationModel.DataTransfer.DataPackagePropertySet; - requestedOperation: Windows.ApplicationModel.DataTransfer.DataPackageOperation; - resourceMap: Windows.Foundation.Collections.IMap; - getView(): Windows.ApplicationModel.DataTransfer.DataPackageView; - onoperationcompleted: any/* TODO */; - ondestroyed: any/* TODO */; - setData(formatId: string, value: any): void; - setDataProvider(formatId: string, delayRenderer: Windows.ApplicationModel.DataTransfer.DataProviderHandler): void; - setText(value: string): void; - setUri(value: Windows.Foundation.Uri): void; - setHtmlFormat(value: string): void; - setRtf(value: string): void; - setBitmap(value: Windows.Storage.Streams.RandomAccessStreamReference): void; - setStorageItems(value: Windows.Foundation.Collections.IIterable): void; - setStorageItems(value: Windows.Foundation.Collections.IIterable, readOnly: boolean): void; - } - export interface IHtmlFormatHelperStatics { - getStaticFragment(htmlFormat: string): string; - createHtmlFormat(htmlFragment: string): string; - } - export class HtmlFormatHelper { - static getStaticFragment(htmlFormat: string): string; - static createHtmlFormat(htmlFragment: string): string; - } - export interface IClipboardStatics { - getContent(): Windows.ApplicationModel.DataTransfer.DataPackageView; - setContent(content: Windows.ApplicationModel.DataTransfer.DataPackage): void; - flush(): void; - clear(): void; - oncontentchanged: any/* TODO */; - } - export class Clipboard { - static getContent(): Windows.ApplicationModel.DataTransfer.DataPackageView; - static setContent(content: Windows.ApplicationModel.DataTransfer.DataPackage): void; - static flush(): void; - static clear(): void; - static oncontentchanged: any/* TODO */; - } - export interface IDataRequestDeferral { - complete(): void; - } - export class DataRequestDeferral implements Windows.ApplicationModel.DataTransfer.IDataRequestDeferral { - complete(): void; - } - export interface IDataRequest { - data: Windows.ApplicationModel.DataTransfer.DataPackage; - deadline: Date; - failWithDisplayText(value: string): void; - getDeferral(): Windows.ApplicationModel.DataTransfer.DataRequestDeferral; - } - export class DataRequest implements Windows.ApplicationModel.DataTransfer.IDataRequest { - data: Windows.ApplicationModel.DataTransfer.DataPackage; - deadline: Date; - failWithDisplayText(value: string): void; - getDeferral(): Windows.ApplicationModel.DataTransfer.DataRequestDeferral; - } - export interface IDataRequestedEventArgs { - request: Windows.ApplicationModel.DataTransfer.DataRequest; - } - export class DataRequestedEventArgs implements Windows.ApplicationModel.DataTransfer.IDataRequestedEventArgs { - request: Windows.ApplicationModel.DataTransfer.DataRequest; - } - export interface ITargetApplicationChosenEventArgs { - applicationName: string; - } - export class TargetApplicationChosenEventArgs implements Windows.ApplicationModel.DataTransfer.ITargetApplicationChosenEventArgs { - applicationName: string; - } - export interface IDataTransferManager { - ondatarequested: any/* TODO */; - ontargetapplicationchosen: any/* TODO */; - } - export class DataTransferManager implements Windows.ApplicationModel.DataTransfer.IDataTransferManager { - ondatarequested: any/* TODO */; - ontargetapplicationchosen: any/* TODO */; - static showShareUI(): void; - static getForCurrentView(): Windows.ApplicationModel.DataTransfer.DataTransferManager; - } - export interface IDataTransferManagerStatics { - showShareUI(): void; - getForCurrentView(): Windows.ApplicationModel.DataTransfer.DataTransferManager; - } - } - } -} -declare module Windows { - export module ApplicationModel { - export module Search { - export interface ISearchPaneQueryLinguisticDetails { - queryTextAlternatives: Windows.Foundation.Collections.IVectorView; - queryTextCompositionLength: number; - queryTextCompositionStart: number; - } - export class SearchPaneQueryLinguisticDetails implements Windows.ApplicationModel.Search.ISearchPaneQueryLinguisticDetails { - queryTextAlternatives: Windows.Foundation.Collections.IVectorView; - queryTextCompositionLength: number; - queryTextCompositionStart: number; - } - export interface ISearchPaneVisibilityChangedEventArgs { - visible: boolean; - } - export class SearchPaneVisibilityChangedEventArgs implements Windows.ApplicationModel.Search.ISearchPaneVisibilityChangedEventArgs { - visible: boolean; - } - export interface ISearchPaneQueryChangedEventArgs { - language: string; - linguisticDetails: Windows.ApplicationModel.Search.SearchPaneQueryLinguisticDetails; - queryText: string; - } - export class SearchPaneQueryChangedEventArgs implements Windows.ApplicationModel.Search.ISearchPaneQueryChangedEventArgs { - language: string; - linguisticDetails: Windows.ApplicationModel.Search.SearchPaneQueryLinguisticDetails; - queryText: string; - } - export interface ISearchPaneQuerySubmittedEventArgs { - language: string; - queryText: string; - } - export class SearchPaneQuerySubmittedEventArgs implements Windows.ApplicationModel.Search.ISearchPaneQuerySubmittedEventArgs { - language: string; - queryText: string; - } - export interface ISearchPaneResultSuggestionChosenEventArgs { - tag: string; - } - export class SearchPaneResultSuggestionChosenEventArgs implements Windows.ApplicationModel.Search.ISearchPaneResultSuggestionChosenEventArgs { - tag: string; - } - export interface ISearchSuggestionCollection { - size: number; - appendQuerySuggestion(text: string): void; - appendQuerySuggestions(suggestions: Windows.Foundation.Collections.IIterable): void; - appendResultSuggestion(text: string, detailText: string, tag: string, image: Windows.Storage.Streams.IRandomAccessStreamReference, imageAlternateText: string): void; - appendSearchSeparator(label: string): void; - } - export class SearchSuggestionCollection implements Windows.ApplicationModel.Search.ISearchSuggestionCollection { - size: number; - appendQuerySuggestion(text: string): void; - appendQuerySuggestions(suggestions: Windows.Foundation.Collections.IIterable): void; - appendResultSuggestion(text: string, detailText: string, tag: string, image: Windows.Storage.Streams.IRandomAccessStreamReference, imageAlternateText: string): void; - appendSearchSeparator(label: string): void; - } - export interface ISearchPaneSuggestionsRequestDeferral { - complete(): void; - } - export interface ISearchPaneSuggestionsRequest { - isCanceled: boolean; - searchSuggestionCollection: Windows.ApplicationModel.Search.SearchSuggestionCollection; - getDeferral(): Windows.ApplicationModel.Search.SearchPaneSuggestionsRequestDeferral; - } - export class SearchPaneSuggestionsRequestDeferral implements Windows.ApplicationModel.Search.ISearchPaneSuggestionsRequestDeferral { - complete(): void; - } - export class SearchPaneSuggestionsRequest implements Windows.ApplicationModel.Search.ISearchPaneSuggestionsRequest { - isCanceled: boolean; - searchSuggestionCollection: Windows.ApplicationModel.Search.SearchSuggestionCollection; - getDeferral(): Windows.ApplicationModel.Search.SearchPaneSuggestionsRequestDeferral; - } - export interface ISearchPaneSuggestionsRequestedEventArgs extends Windows.ApplicationModel.Search.ISearchPaneQueryChangedEventArgs { - request: Windows.ApplicationModel.Search.SearchPaneSuggestionsRequest; - } - export class SearchPaneSuggestionsRequestedEventArgs implements Windows.ApplicationModel.Search.ISearchPaneSuggestionsRequestedEventArgs, Windows.ApplicationModel.Search.ISearchPaneQueryChangedEventArgs { - request: Windows.ApplicationModel.Search.SearchPaneSuggestionsRequest; - language: string; - linguisticDetails: Windows.ApplicationModel.Search.SearchPaneQueryLinguisticDetails; - queryText: string; - } - export interface ILocalContentSuggestionSettings { - aqsFilter: string; - enabled: boolean; - locations: Windows.Foundation.Collections.IVector; - propertiesToMatch: Windows.Foundation.Collections.IVector; - } - export class LocalContentSuggestionSettings implements Windows.ApplicationModel.Search.ILocalContentSuggestionSettings { - aqsFilter: string; - enabled: boolean; - locations: Windows.Foundation.Collections.IVector; - propertiesToMatch: Windows.Foundation.Collections.IVector; - } - export interface ISearchPaneStatics { - getForCurrentView(): Windows.ApplicationModel.Search.SearchPane; - } - export class SearchPane implements Windows.ApplicationModel.Search.ISearchPane { - language: string; - placeholderText: string; - queryText: string; - searchHistoryContext: string; - searchHistoryEnabled: boolean; - showOnKeyboardInput: boolean; - visible: boolean; - onvisibilitychanged: any/* TODO */; - onquerychanged: any/* TODO */; - onsuggestionsrequested: any/* TODO */; - onquerysubmitted: any/* TODO */; - onresultsuggestionchosen: any/* TODO */; - setLocalContentSuggestionSettings(settings: Windows.ApplicationModel.Search.LocalContentSuggestionSettings): void; - show(): void; - show(query: string): void; - trySetQueryText(query: string): boolean; - static getForCurrentView(): Windows.ApplicationModel.Search.SearchPane; - } - export interface ISearchPane { - language: string; - placeholderText: string; - queryText: string; - searchHistoryContext: string; - searchHistoryEnabled: boolean; - showOnKeyboardInput: boolean; - visible: boolean; - onvisibilitychanged: any/* TODO */; - onquerychanged: any/* TODO */; - onsuggestionsrequested: any/* TODO */; - onquerysubmitted: any/* TODO */; - onresultsuggestionchosen: any/* TODO */; - setLocalContentSuggestionSettings(settings: Windows.ApplicationModel.Search.LocalContentSuggestionSettings): void; - show(): void; - show(query: string): void; - trySetQueryText(query: string): boolean; - } - } - } -} -declare module Windows { - export module ApplicationModel { - export module DataTransfer { - export module ShareTarget { - export interface IQuickLink { - id: string; - supportedDataFormats: Windows.Foundation.Collections.IVector; - supportedFileTypes: Windows.Foundation.Collections.IVector; - thumbnail: Windows.Storage.Streams.RandomAccessStreamReference; - title: string; - } - export class QuickLink implements Windows.ApplicationModel.DataTransfer.ShareTarget.IQuickLink { - id: string; - supportedDataFormats: Windows.Foundation.Collections.IVector; - supportedFileTypes: Windows.Foundation.Collections.IVector; - thumbnail: Windows.Storage.Streams.RandomAccessStreamReference; - title: string; - } - export interface IShareOperation { - data: Windows.ApplicationModel.DataTransfer.DataPackageView; - quickLinkId: string; - removeThisQuickLink(): void; - reportStarted(): void; - reportDataRetrieved(): void; - reportSubmittedBackgroundTask(): void; - reportCompleted(quicklink: Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink): void; - reportCompleted(): void; - reportError(value: string): void; - } - export class ShareOperation implements Windows.ApplicationModel.DataTransfer.ShareTarget.IShareOperation { - data: Windows.ApplicationModel.DataTransfer.DataPackageView; - quickLinkId: string; - removeThisQuickLink(): void; - reportStarted(): void; - reportDataRetrieved(): void; - reportSubmittedBackgroundTask(): void; - reportCompleted(quicklink: Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink): void; - reportCompleted(): void; - reportError(value: string): void; - } - } - } - } -} -declare module Windows { - export module ApplicationModel { - export module Activation { - export interface ISplashScreen { - imageLocation: Windows.Foundation.Rect; - ondismissed: any/* TODO */; - } - export class SplashScreen implements Windows.ApplicationModel.Activation.ISplashScreen { - imageLocation: Windows.Foundation.Rect; - ondismissed: any/* TODO */; - } - export enum ApplicationExecutionState { - notRunning, - running, - suspended, - terminated, - closedByUser, - } - export enum ActivationKind { - launch, - search, - shareTarget, - file, - protocol, - fileOpenPicker, - fileSavePicker, - cachedFileUpdater, - contactPicker, - device, - printTaskSettings, - cameraSettings, - } - export interface IActivatedEventArgs { - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - } - export interface ILaunchActivatedEventArgs extends Windows.ApplicationModel.Activation.IActivatedEventArgs { - arguments: string; - tileId: string; - } - export class LaunchActivatedEventArgs implements Windows.ApplicationModel.Activation.ILaunchActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs { - arguments: string; - tileId: string; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - } - export interface ISearchActivatedEventArgs extends Windows.ApplicationModel.Activation.IActivatedEventArgs { - language: string; - queryText: string; - } - export class SearchActivatedEventArgs implements Windows.ApplicationModel.Activation.ISearchActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs { - language: string; - queryText: string; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - } - export interface IShareTargetActivatedEventArgs extends Windows.ApplicationModel.Activation.IActivatedEventArgs { - shareOperation: Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation; - } - export class ShareTargetActivatedEventArgs implements Windows.ApplicationModel.Activation.IShareTargetActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs { - shareOperation: Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - } - export interface IFileActivatedEventArgs extends Windows.ApplicationModel.Activation.IActivatedEventArgs { - files: Windows.Foundation.Collections.IVectorView; - verb: string; - } - export class FileActivatedEventArgs implements Windows.ApplicationModel.Activation.IFileActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs { - files: Windows.Foundation.Collections.IVectorView; - verb: string; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - } - export interface IProtocolActivatedEventArgs extends Windows.ApplicationModel.Activation.IActivatedEventArgs { - uri: Windows.Foundation.Uri; - } - export class ProtocolActivatedEventArgs implements Windows.ApplicationModel.Activation.IProtocolActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs { - uri: Windows.Foundation.Uri; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - } - export interface IFileOpenPickerActivatedEventArgs extends Windows.ApplicationModel.Activation.IActivatedEventArgs { - fileOpenPickerUI: Windows.Storage.Pickers.Provider.FileOpenPickerUI; - } - export class FileOpenPickerActivatedEventArgs implements Windows.ApplicationModel.Activation.IFileOpenPickerActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs { - fileOpenPickerUI: Windows.Storage.Pickers.Provider.FileOpenPickerUI; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - } - export interface IFileSavePickerActivatedEventArgs extends Windows.ApplicationModel.Activation.IActivatedEventArgs { - fileSavePickerUI: Windows.Storage.Pickers.Provider.FileSavePickerUI; - } - export class FileSavePickerActivatedEventArgs implements Windows.ApplicationModel.Activation.IFileSavePickerActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs { - fileSavePickerUI: Windows.Storage.Pickers.Provider.FileSavePickerUI; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - } - export interface ICachedFileUpdaterActivatedEventArgs extends Windows.ApplicationModel.Activation.IActivatedEventArgs { - cachedFileUpdaterUI: Windows.Storage.Provider.CachedFileUpdaterUI; - } - export class CachedFileUpdaterActivatedEventArgs implements Windows.ApplicationModel.Activation.ICachedFileUpdaterActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs { - cachedFileUpdaterUI: Windows.Storage.Provider.CachedFileUpdaterUI; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - } - export interface IContactPickerActivatedEventArgs extends Windows.ApplicationModel.Activation.IActivatedEventArgs { - contactPickerUI: Windows.ApplicationModel.Contacts.Provider.ContactPickerUI; - } - export class ContactPickerActivatedEventArgs implements Windows.ApplicationModel.Activation.IContactPickerActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs { - contactPickerUI: Windows.ApplicationModel.Contacts.Provider.ContactPickerUI; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - } - export interface IDeviceActivatedEventArgs extends Windows.ApplicationModel.Activation.IActivatedEventArgs { - deviceInformationId: string; - verb: string; - } - export class DeviceActivatedEventArgs implements Windows.ApplicationModel.Activation.IDeviceActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs { - deviceInformationId: string; - verb: string; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - } - export interface IPrintTaskSettingsActivatedEventArgs extends Windows.ApplicationModel.Activation.IActivatedEventArgs { - configuration: Windows.Devices.Printers.Extensions.PrintTaskConfiguration; - } - export class PrintTaskSettingsActivatedEventArgs implements Windows.ApplicationModel.Activation.IPrintTaskSettingsActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs { - configuration: Windows.Devices.Printers.Extensions.PrintTaskConfiguration; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - } - export interface ICameraSettingsActivatedEventArgs extends Windows.ApplicationModel.Activation.IActivatedEventArgs { - videoDeviceController: any; - videoDeviceExtension: any; - } - export class CameraSettingsActivatedEventArgs implements Windows.ApplicationModel.Activation.ICameraSettingsActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs { - videoDeviceController: any; - videoDeviceExtension: any; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - } - } - } -} -declare module Windows { - export module ApplicationModel { - export module Core { - export class CoreApplication { - static mainView: Windows.ApplicationModel.Core.CoreApplicationView; - static views: Windows.Foundation.Collections.IVectorView; - static id: string; - static properties: Windows.Foundation.Collections.IPropertySet; - static incrementApplicationUseCount(): void; - static decrementApplicationUseCount(): void; - static createNewView(runtimeType: string, entryPoint: string): Windows.ApplicationModel.Core.CoreApplicationView; - static exit(): void; - static onexiting: any/* TODO */; - static onsuspending: any/* TODO */; - static onresuming: any/* TODO */; - static getCurrentView(): Windows.ApplicationModel.Core.CoreApplicationView; - static run(viewSource: Windows.ApplicationModel.Core.IFrameworkViewSource): void; - static runWithActivationFactories(activationFactoryCallback: Windows.Foundation.IGetActivationFactory): void; - } - export class CoreApplicationView implements Windows.ApplicationModel.Core.ICoreApplicationView { - coreWindow: Windows.UI.Core.CoreWindow; - isHosted: boolean; - isMain: boolean; - onactivated: any/* TODO */; - } - export interface IFrameworkView { - initialize(applicationView: Windows.ApplicationModel.Core.CoreApplicationView): void; - setWindow(window: Windows.UI.Core.CoreWindow): void; - load(entryPoint: string): void; - run(): void; - uninitialize(): void; - } - export interface IFrameworkViewSource { - createView(): Windows.ApplicationModel.Core.IFrameworkView; - } - export interface ICoreApplication { - id: string; - properties: Windows.Foundation.Collections.IPropertySet; - onsuspending: any/* TODO */; - onresuming: any/* TODO */; - getCurrentView(): Windows.ApplicationModel.Core.CoreApplicationView; - run(viewSource: Windows.ApplicationModel.Core.IFrameworkViewSource): void; - runWithActivationFactories(activationFactoryCallback: Windows.Foundation.IGetActivationFactory): void; - } - export interface ICoreApplicationUseCount { - incrementApplicationUseCount(): void; - decrementApplicationUseCount(): void; - } - export interface ICoreApplicationExit { - exit(): void; - onexiting: any/* TODO */; - } - export interface ICoreImmersiveApplication { - mainView: Windows.ApplicationModel.Core.CoreApplicationView; - views: Windows.Foundation.Collections.IVectorView; - createNewView(runtimeType: string, entryPoint: string): Windows.ApplicationModel.Core.CoreApplicationView; - } - export interface ICoreApplicationView { - coreWindow: Windows.UI.Core.CoreWindow; - isHosted: boolean; - isMain: boolean; - onactivated: any/* TODO */; - } - } - } -} -declare module Windows { - export module ApplicationModel { - export class SuspendingEventArgs implements Windows.ApplicationModel.ISuspendingEventArgs { - suspendingOperation: Windows.ApplicationModel.SuspendingOperation; - } - export interface ISuspendingDeferral { - complete(): void; - } - export class SuspendingDeferral implements Windows.ApplicationModel.ISuspendingDeferral { - complete(): void; - } - export interface ISuspendingOperation { - deadline: Date; - getDeferral(): Windows.ApplicationModel.SuspendingDeferral; - } - export class SuspendingOperation implements Windows.ApplicationModel.ISuspendingOperation { - deadline: Date; - getDeferral(): Windows.ApplicationModel.SuspendingDeferral; - } - export interface ISuspendingEventArgs { - suspendingOperation: Windows.ApplicationModel.SuspendingOperation; - } - export interface PackageVersion { - major: number; - minor: number; - build: number; - revision: number; - } - export interface IPackageId { - architecture: Windows.System.ProcessorArchitecture; - familyName: string; - fullName: string; - name: string; - publisher: string; - publisherId: string; - resourceId: string; - version: Windows.ApplicationModel.PackageVersion; - } - export class PackageId implements Windows.ApplicationModel.IPackageId { - architecture: Windows.System.ProcessorArchitecture; - familyName: string; - fullName: string; - name: string; - publisher: string; - publisherId: string; - resourceId: string; - version: Windows.ApplicationModel.PackageVersion; - } - export interface IPackage { - dependencies: Windows.Foundation.Collections.IVectorView; - id: Windows.ApplicationModel.PackageId; - installedLocation: Windows.Storage.StorageFolder; - isFramework: boolean; - } - export class Package implements Windows.ApplicationModel.IPackage { - dependencies: Windows.Foundation.Collections.IVectorView; - id: Windows.ApplicationModel.PackageId; - installedLocation: Windows.Storage.StorageFolder; - isFramework: boolean; - static current: Windows.ApplicationModel.Package; - } - export interface IPackageStatics { - current: Windows.ApplicationModel.Package; - } - export interface IDesignModeStatics { - designModeEnabled: boolean; - } - export class DesignMode { - static designModeEnabled: boolean; - } - } -} -declare module Windows { - export module ApplicationModel { - export module Resources { - export interface IResourceLoader { - getString(resource: string): string; - } - export class ResourceLoader implements Windows.ApplicationModel.Resources.IResourceLoader { - constructor(name: string); - constructor(); - getString(resource: string): string; - static getStringForReference(uri: Windows.Foundation.Uri): string; - } - export interface IResourceLoaderStatics { - getStringForReference(uri: Windows.Foundation.Uri): string; - } - export interface IResourceLoaderFactory { - createResourceLoaderByName(name: string): Windows.ApplicationModel.Resources.ResourceLoader; - } - } - } -} -declare module Windows { - export module ApplicationModel { - export module Resources { - export module Core { - export interface IResourceManager { - allResourceMaps: Windows.Foundation.Collections.IMapView; - defaultContext: Windows.ApplicationModel.Resources.Core.ResourceContext; - mainResourceMap: Windows.ApplicationModel.Resources.Core.ResourceMap; - loadPriFiles(files: Windows.Foundation.Collections.IIterable): void; - unloadPriFiles(files: Windows.Foundation.Collections.IIterable): void; - } - export class ResourceMap implements Windows.ApplicationModel.Resources.Core.IResourceMap, Windows.Foundation.Collections.IMapView, Windows.Foundation.Collections.IIterable> { - uri: Windows.Foundation.Uri; - size: number; - getValue(resource: string): Windows.ApplicationModel.Resources.Core.ResourceCandidate; - getValue(resource: string, context: Windows.ApplicationModel.Resources.Core.ResourceContext): Windows.ApplicationModel.Resources.Core.ResourceCandidate; - getSubtree(reference: string): Windows.ApplicationModel.Resources.Core.ResourceMap; - lookup(key: string): Windows.ApplicationModel.Resources.Core.NamedResource; - hasKey(key: string): boolean; - split(): { first: Windows.Foundation.Collections.IMapView; second: Windows.Foundation.Collections.IMapView; }; - first(): Windows.Foundation.Collections.IIterator>; - } - export class ResourceContext implements Windows.ApplicationModel.Resources.Core.IResourceContext { - languages: Windows.Foundation.Collections.IVectorView; - qualifierValues: Windows.Foundation.Collections.IObservableMap; - reset(): void; - reset(qualifierNames: Windows.Foundation.Collections.IIterable): void; - overrideToMatch(result: Windows.Foundation.Collections.IIterable): void; - clone(): Windows.ApplicationModel.Resources.Core.ResourceContext; - static createMatchingContext(result: Windows.Foundation.Collections.IIterable): Windows.ApplicationModel.Resources.Core.ResourceContext; - } - export interface IResourceManagerStatics { - current: Windows.ApplicationModel.Resources.Core.ResourceManager; - isResourceReference(resourceReference: string): boolean; - } - export class ResourceManager implements Windows.ApplicationModel.Resources.Core.IResourceManager { - allResourceMaps: Windows.Foundation.Collections.IMapView; - defaultContext: Windows.ApplicationModel.Resources.Core.ResourceContext; - mainResourceMap: Windows.ApplicationModel.Resources.Core.ResourceMap; - loadPriFiles(files: Windows.Foundation.Collections.IIterable): void; - unloadPriFiles(files: Windows.Foundation.Collections.IIterable): void; - static current: Windows.ApplicationModel.Resources.Core.ResourceManager; - static isResourceReference(resourceReference: string): boolean; - } - export interface IResourceQualifier { - isDefault: boolean; - isMatch: boolean; - qualifierName: string; - qualifierValue: string; - score: number; - } - export class ResourceQualifier implements Windows.ApplicationModel.Resources.Core.IResourceQualifier { - isDefault: boolean; - isMatch: boolean; - qualifierName: string; - qualifierValue: string; - score: number; - } - export interface IResourceContext { - languages: Windows.Foundation.Collections.IVectorView; - qualifierValues: Windows.Foundation.Collections.IObservableMap; - reset(): void; - reset(qualifierNames: Windows.Foundation.Collections.IIterable): void; - overrideToMatch(result: Windows.Foundation.Collections.IIterable): void; - clone(): Windows.ApplicationModel.Resources.Core.ResourceContext; - } - export interface IResourceContextStatics { - createMatchingContext(result: Windows.Foundation.Collections.IIterable): Windows.ApplicationModel.Resources.Core.ResourceContext; - } - export interface IResourceCandidate { - isDefault: boolean; - isMatch: boolean; - isMatchAsDefault: boolean; - qualifiers: Windows.Foundation.Collections.IVectorView; - valueAsString: string; - getValueAsFileAsync(): Windows.Foundation.IAsyncOperation; - getQualifierValue(qualifierName: string): string; - } - export class ResourceCandidate implements Windows.ApplicationModel.Resources.Core.IResourceCandidate { - isDefault: boolean; - isMatch: boolean; - isMatchAsDefault: boolean; - qualifiers: Windows.Foundation.Collections.IVectorView; - valueAsString: string; - getValueAsFileAsync(): Windows.Foundation.IAsyncOperation; - getQualifierValue(qualifierName: string): string; - } - export interface INamedResource { - candidates: Windows.Foundation.Collections.IVectorView; - uri: Windows.Foundation.Uri; - resolve(): Windows.ApplicationModel.Resources.Core.ResourceCandidate; - resolve(resourceContext: Windows.ApplicationModel.Resources.Core.ResourceContext): Windows.ApplicationModel.Resources.Core.ResourceCandidate; - resolveAll(): Windows.Foundation.Collections.IVectorView; - resolveAll(resourceContext: Windows.ApplicationModel.Resources.Core.ResourceContext): Windows.Foundation.Collections.IVectorView; - } - export class NamedResource implements Windows.ApplicationModel.Resources.Core.INamedResource { - candidates: Windows.Foundation.Collections.IVectorView; - uri: Windows.Foundation.Uri; - resolve(): Windows.ApplicationModel.Resources.Core.ResourceCandidate; - resolve(resourceContext: Windows.ApplicationModel.Resources.Core.ResourceContext): Windows.ApplicationModel.Resources.Core.ResourceCandidate; - resolveAll(): Windows.Foundation.Collections.IVectorView; - resolveAll(resourceContext: Windows.ApplicationModel.Resources.Core.ResourceContext): Windows.Foundation.Collections.IVectorView; - } - export interface IResourceMap extends Windows.Foundation.Collections.IMapView, Windows.Foundation.Collections.IIterable> { - uri: Windows.Foundation.Uri; - getValue(resource: string): Windows.ApplicationModel.Resources.Core.ResourceCandidate; - getValue(resource: string, context: Windows.ApplicationModel.Resources.Core.ResourceContext): Windows.ApplicationModel.Resources.Core.ResourceCandidate; - getSubtree(reference: string): Windows.ApplicationModel.Resources.Core.ResourceMap; - } - export class ResourceMapIterator implements Windows.Foundation.Collections.IIterator> { - current: Windows.Foundation.Collections.IKeyValuePair; - hasCurrent: boolean; - moveNext(): boolean; - getMany(): { items: Windows.Foundation.Collections.IKeyValuePair[]; returnValue: number; }; - } - export class ResourceMapMapView implements Windows.Foundation.Collections.IMapView, Windows.Foundation.Collections.IIterable> { - size: number; - lookup(key: string): Windows.ApplicationModel.Resources.Core.ResourceMap; - hasKey(key: string): boolean; - split(): { first: Windows.Foundation.Collections.IMapView; second: Windows.Foundation.Collections.IMapView; }; - first(): Windows.Foundation.Collections.IIterator>; - } - export class ResourceMapMapViewIterator implements Windows.Foundation.Collections.IIterator> { - current: Windows.Foundation.Collections.IKeyValuePair; - hasCurrent: boolean; - moveNext(): boolean; - getMany(): { items: Windows.Foundation.Collections.IKeyValuePair[]; returnValue: number; }; - } - export class ResourceQualifierObservableMap implements Windows.Foundation.Collections.IObservableMap, Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { - size: number; - onmapchanged: any/* TODO */; - lookup(key: string): string; - hasKey(key: string): boolean; - getView(): Windows.Foundation.Collections.IMapView; - insert(key: string, value: string): boolean; - remove(key: string): void; - clear(): void; - first(): Windows.Foundation.Collections.IIterator>; - } - export class ResourceQualifierMapView implements Windows.Foundation.Collections.IMapView, Windows.Foundation.Collections.IIterable> { - size: number; - lookup(key: string): string; - hasKey(key: string): boolean; - split(): { first: Windows.Foundation.Collections.IMapView; second: Windows.Foundation.Collections.IMapView; }; - first(): Windows.Foundation.Collections.IIterator>; - } - export class ResourceQualifierVectorView implements Windows.Foundation.Collections.IVectorView, Windows.Foundation.Collections.IIterable { - size: number; - getAt(index: number): Windows.ApplicationModel.Resources.Core.ResourceQualifier; - indexOf(value: Windows.ApplicationModel.Resources.Core.ResourceQualifier): { index: number; returnValue: boolean; }; - getMany(startIndex: number): { items: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]; returnValue: number; }; - first(): Windows.Foundation.Collections.IIterator; - toString(): string; - toLocaleString(): string; - concat(...items: Windows.ApplicationModel.Resources.Core.ResourceQualifier[][]): Windows.ApplicationModel.Resources.Core.ResourceQualifier[]; - join(seperator: string): string; - pop(): Windows.ApplicationModel.Resources.Core.ResourceQualifier; - push(...items: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]): void; - reverse(): Windows.ApplicationModel.Resources.Core.ResourceQualifier[]; - shift(): Windows.ApplicationModel.Resources.Core.ResourceQualifier; - slice(start: number): Windows.ApplicationModel.Resources.Core.ResourceQualifier[]; - slice(start: number, end: number): Windows.ApplicationModel.Resources.Core.ResourceQualifier[]; - sort(): Windows.ApplicationModel.Resources.Core.ResourceQualifier[]; - sort(compareFn: (a: Windows.ApplicationModel.Resources.Core.ResourceQualifier, b: Windows.ApplicationModel.Resources.Core.ResourceQualifier) => number): Windows.ApplicationModel.Resources.Core.ResourceQualifier[]; - splice(start: number): Windows.ApplicationModel.Resources.Core.ResourceQualifier[]; - splice(start: number, deleteCount: number, ...items: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]): Windows.ApplicationModel.Resources.Core.ResourceQualifier[]; - unshift(...items: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]): number; - lastIndexOf(searchElement: Windows.ApplicationModel.Resources.Core.ResourceQualifier): number; - lastIndexOf(searchElement: Windows.ApplicationModel.Resources.Core.ResourceQualifier, fromIndex: number): number; - every(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => boolean): boolean; - every(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => boolean): boolean; - some(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => void ): void; - forEach(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => void , thisArg: any): void; - map(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => any): any[]; - map(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => boolean): Windows.ApplicationModel.Resources.Core.ResourceQualifier[]; - filter(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => boolean, thisArg: any): Windows.ApplicationModel.Resources.Core.ResourceQualifier[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => any, initialValue: any): any; - length: number; - } - export class ResourceCandidateVectorView implements Windows.Foundation.Collections.IVectorView, Windows.Foundation.Collections.IIterable { - size: number; - getAt(index: number): Windows.ApplicationModel.Resources.Core.ResourceCandidate; - indexOf(value: Windows.ApplicationModel.Resources.Core.ResourceCandidate): { index: number; returnValue: boolean; }; - getMany(startIndex: number): { items: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]; returnValue: number; }; - first(): Windows.Foundation.Collections.IIterator; - toString(): string; - toLocaleString(): string; - concat(...items: Windows.ApplicationModel.Resources.Core.ResourceCandidate[][]): Windows.ApplicationModel.Resources.Core.ResourceCandidate[]; - join(seperator: string): string; - pop(): Windows.ApplicationModel.Resources.Core.ResourceCandidate; - push(...items: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]): void; - reverse(): Windows.ApplicationModel.Resources.Core.ResourceCandidate[]; - shift(): Windows.ApplicationModel.Resources.Core.ResourceCandidate; - slice(start: number): Windows.ApplicationModel.Resources.Core.ResourceCandidate[]; - slice(start: number, end: number): Windows.ApplicationModel.Resources.Core.ResourceCandidate[]; - sort(): Windows.ApplicationModel.Resources.Core.ResourceCandidate[]; - sort(compareFn: (a: Windows.ApplicationModel.Resources.Core.ResourceCandidate, b: Windows.ApplicationModel.Resources.Core.ResourceCandidate) => number): Windows.ApplicationModel.Resources.Core.ResourceCandidate[]; - splice(start: number): Windows.ApplicationModel.Resources.Core.ResourceCandidate[]; - splice(start: number, deleteCount: number, ...items: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]): Windows.ApplicationModel.Resources.Core.ResourceCandidate[]; - unshift(...items: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]): number; - lastIndexOf(searchElement: Windows.ApplicationModel.Resources.Core.ResourceCandidate): number; - lastIndexOf(searchElement: Windows.ApplicationModel.Resources.Core.ResourceCandidate, fromIndex: number): number; - every(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => boolean): boolean; - every(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => boolean): boolean; - some(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => void ): void; - forEach(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => void , thisArg: any): void; - map(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => any): any[]; - map(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => boolean): Windows.ApplicationModel.Resources.Core.ResourceCandidate[]; - filter(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => boolean, thisArg: any): Windows.ApplicationModel.Resources.Core.ResourceCandidate[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => any, initialValue: any): any; - length: number; - } - export class ResourceContextLanguagesVectorView implements Windows.Foundation.Collections.IVectorView, Windows.Foundation.Collections.IIterable { - size: number; - getAt(index: number): string; - indexOf(value: string): { index: number; returnValue: boolean; }; - getMany(startIndex: number): { items: string[]; returnValue: number; }; - first(): Windows.Foundation.Collections.IIterator; - toString(): string; - toLocaleString(): string; - concat(...items: string[][]): string[]; - join(seperator: string): string; - pop(): string; - push(...items: string[]): void; - reverse(): string[]; - shift(): string; - slice(start: number): string[]; - slice(start: number, end: number): string[]; - sort(): string[]; - sort(compareFn: (a: string, b: string) => number): string[]; - splice(start: number): string[]; - splice(start: number, deleteCount: number, ...items: string[]): string[]; - unshift(...items: string[]): number; - lastIndexOf(searchElement: string): number; - lastIndexOf(searchElement: string, fromIndex: number): number; - every(callbackfn: (value: string, index: number, array: string[]) => boolean): boolean; - every(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: string, index: number, array: string[]) => boolean): boolean; - some(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: string, index: number, array: string[]) => void ): void; - forEach(callbackfn: (value: string, index: number, array: string[]) => void , thisArg: any): void; - map(callbackfn: (value: string, index: number, array: string[]) => any): any[]; - map(callbackfn: (value: string, index: number, array: string[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: string, index: number, array: string[]) => boolean): string[]; - filter(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg: any): string[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue: any): any; - length: number; - } - } - } - } -} -declare module Windows { - export module ApplicationModel { - export module Resources { - export module Management { - export enum IndexedResourceType { - string, - path, - } - export interface IResourceIndexer { - indexFilePath(filePath: Windows.Foundation.Uri): Windows.ApplicationModel.Resources.Management.IndexedResourceCandidate; - indexFileContentsAsync(file: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation>; - } - export class IndexedResourceCandidate implements Windows.ApplicationModel.Resources.Management.IIndexedResourceCandidate { - metadata: Windows.Foundation.Collections.IMapView; - qualifiers: Windows.Foundation.Collections.IVectorView; - type: Windows.ApplicationModel.Resources.Management.IndexedResourceType; - uri: Windows.Foundation.Uri; - valueAsString: string; - getQualifierValue(qualifierName: string): string; - } - export interface IResourceIndexerFactory { - createResourceIndexer(projectRoot: Windows.Foundation.Uri): Windows.ApplicationModel.Resources.Management.ResourceIndexer; - } - export class ResourceIndexer implements Windows.ApplicationModel.Resources.Management.IResourceIndexer { - constructor(projectRoot: Windows.Foundation.Uri); - indexFilePath(filePath: Windows.Foundation.Uri): Windows.ApplicationModel.Resources.Management.IndexedResourceCandidate; - indexFileContentsAsync(file: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation>; - } - export interface IIndexedResourceQualifier { - qualifierName: string; - qualifierValue: string; - } - export interface IIndexedResourceCandidate { - metadata: Windows.Foundation.Collections.IMapView; - qualifiers: Windows.Foundation.Collections.IVectorView; - type: Windows.ApplicationModel.Resources.Management.IndexedResourceType; - uri: Windows.Foundation.Uri; - valueAsString: string; - getQualifierValue(qualifierName: string): string; - } - export class IndexedResourceQualifier implements Windows.ApplicationModel.Resources.Management.IIndexedResourceQualifier { - qualifierName: string; - qualifierValue: string; - } - } - } - } -} -declare module Windows { - export module ApplicationModel { - export module Store { - export interface LicenseChangedEventHandler { - (): void; - } - export interface ICurrentApp { - appId: string; - licenseInformation: Windows.ApplicationModel.Store.LicenseInformation; - linkUri: Windows.Foundation.Uri; - requestAppPurchaseAsync(includeReceipt: boolean): Windows.Foundation.IAsyncOperation; - requestProductPurchaseAsync(productId: string, includeReceipt: boolean): Windows.Foundation.IAsyncOperation; - loadListingInformationAsync(): Windows.Foundation.IAsyncOperation; - getAppReceiptAsync(): Windows.Foundation.IAsyncOperation; - getProductReceiptAsync(productId: string): Windows.Foundation.IAsyncOperation; - } - export class LicenseInformation implements Windows.ApplicationModel.Store.ILicenseInformation { - expirationDate: Date; - isActive: boolean; - isTrial: boolean; - productLicenses: Windows.Foundation.Collections.IMapView; - onlicensechanged: any/* TODO */; - } - export class ListingInformation implements Windows.ApplicationModel.Store.IListingInformation { - ageRating: number; - currentMarket: string; - description: string; - formattedPrice: string; - name: string; - productListings: Windows.Foundation.Collections.IMapView; - } - export interface ICurrentAppSimulator { - appId: string; - licenseInformation: Windows.ApplicationModel.Store.LicenseInformation; - linkUri: Windows.Foundation.Uri; - requestAppPurchaseAsync(includeReceipt: boolean): Windows.Foundation.IAsyncOperation; - requestProductPurchaseAsync(productId: string, includeReceipt: boolean): Windows.Foundation.IAsyncOperation; - loadListingInformationAsync(): Windows.Foundation.IAsyncOperation; - getAppReceiptAsync(): Windows.Foundation.IAsyncOperation; - getProductReceiptAsync(productId: string): Windows.Foundation.IAsyncOperation; - reloadSimulatorAsync(simulatorSettingsFile: Windows.Storage.StorageFile): Windows.Foundation.IAsyncAction; - } - export interface ILicenseInformation { - expirationDate: Date; - isActive: boolean; - isTrial: boolean; - productLicenses: Windows.Foundation.Collections.IMapView; - onlicensechanged: any/* TODO */; - } - export class ProductLicense implements Windows.ApplicationModel.Store.IProductLicense { - expirationDate: Date; - isActive: boolean; - productId: string; - } - export interface IProductLicense { - expirationDate: Date; - isActive: boolean; - productId: string; - } - export interface IListingInformation { - ageRating: number; - currentMarket: string; - description: string; - formattedPrice: string; - name: string; - productListings: Windows.Foundation.Collections.IMapView; - } - export class ProductListing implements Windows.ApplicationModel.Store.IProductListing { - formattedPrice: string; - name: string; - productId: string; - } - export interface IProductListing { - formattedPrice: string; - name: string; - productId: string; - } - export class CurrentApp { - static appId: string; - static licenseInformation: Windows.ApplicationModel.Store.LicenseInformation; - static linkUri: Windows.Foundation.Uri; - static requestAppPurchaseAsync(includeReceipt: boolean): Windows.Foundation.IAsyncOperation; - static requestProductPurchaseAsync(productId: string, includeReceipt: boolean): Windows.Foundation.IAsyncOperation; - static loadListingInformationAsync(): Windows.Foundation.IAsyncOperation; - static getAppReceiptAsync(): Windows.Foundation.IAsyncOperation; - static getProductReceiptAsync(productId: string): Windows.Foundation.IAsyncOperation; - } - export class CurrentAppSimulator { - static appId: string; - static licenseInformation: Windows.ApplicationModel.Store.LicenseInformation; - static linkUri: Windows.Foundation.Uri; - static requestAppPurchaseAsync(includeReceipt: boolean): Windows.Foundation.IAsyncOperation; - static requestProductPurchaseAsync(productId: string, includeReceipt: boolean): Windows.Foundation.IAsyncOperation; - static loadListingInformationAsync(): Windows.Foundation.IAsyncOperation; - static getAppReceiptAsync(): Windows.Foundation.IAsyncOperation; - static getProductReceiptAsync(productId: string): Windows.Foundation.IAsyncOperation; - static reloadSimulatorAsync(simulatorSettingsFile: Windows.Storage.StorageFile): Windows.Foundation.IAsyncAction; - } - } - } -} -declare module Windows { - export module Data { - export module Html { - export interface IHtmlUtilities { - convertToText(html: string): string; - } - export class HtmlUtilities { - static convertToText(html: string): string; - } - } - } -} -declare module Windows { - export module Data { - export module Json { - export enum JsonValueType { - null_, - boolean, - number, - string, - array, - object, - } - export enum JsonErrorStatus { - unknown, - invalidJsonString, - invalidJsonNumber, - jsonValueNotFound, - implementationLimit, - } - export interface IJsonValue { - valueType: Windows.Data.Json.JsonValueType; - stringify(): string; - getString(): string; - getNumber(): number; - getBoolean(): boolean; - getArray(): Windows.Data.Json.JsonArray; - getObject(): Windows.Data.Json.JsonObject; - } - export class JsonArray implements Windows.Data.Json.IJsonArray, Windows.Data.Json.IJsonValue, Windows.Foundation.Collections.IVector, Windows.Foundation.Collections.IIterable { - valueType: Windows.Data.Json.JsonValueType; - size: number; - getObjectAt(index: number): Windows.Data.Json.JsonObject; - getArrayAt(index: number): Windows.Data.Json.JsonArray; - getStringAt(index: number): string; - getNumberAt(index: number): number; - getBooleanAt(index: number): boolean; - stringify(): string; - getString(): string; - getNumber(): number; - getBoolean(): boolean; - getArray(): Windows.Data.Json.JsonArray; - getObject(): Windows.Data.Json.JsonObject; - getAt(index: number): Windows.Data.Json.IJsonValue; - getView(): Windows.Foundation.Collections.IVectorView; - indexOf(value: Windows.Data.Json.IJsonValue): { index: number; returnValue: boolean; }; - setAt(index: number, value: Windows.Data.Json.IJsonValue): void; - insertAt(index: number, value: Windows.Data.Json.IJsonValue): void; - removeAt(index: number): void; - append(value: Windows.Data.Json.IJsonValue): void; - removeAtEnd(): void; - clear(): void; - getMany(startIndex: number): { items: Windows.Data.Json.IJsonValue[]; returnValue: number; }; - replaceAll(items: Windows.Data.Json.IJsonValue[]): void; - first(): Windows.Foundation.Collections.IIterator; - static parse(input: string): Windows.Data.Json.JsonArray; - static tryParse(input: string): { result: Windows.Data.Json.JsonArray; succeeded: boolean; }; - toString(): string; - toLocaleString(): string; - concat(...items: Windows.Data.Json.IJsonValue[][]): Windows.Data.Json.IJsonValue[]; - join(seperator: string): string; - pop(): Windows.Data.Json.IJsonValue; - push(...items: Windows.Data.Json.IJsonValue[]): void; - reverse(): Windows.Data.Json.IJsonValue[]; - shift(): Windows.Data.Json.IJsonValue; - slice(start: number): Windows.Data.Json.IJsonValue[]; - slice(start: number, end: number): Windows.Data.Json.IJsonValue[]; - sort(): Windows.Data.Json.IJsonValue[]; - sort(compareFn: (a: Windows.Data.Json.IJsonValue, b: Windows.Data.Json.IJsonValue) => number): Windows.Data.Json.IJsonValue[]; - splice(start: number): Windows.Data.Json.IJsonValue[]; - splice(start: number, deleteCount: number, ...items: Windows.Data.Json.IJsonValue[]): Windows.Data.Json.IJsonValue[]; - unshift(...items: Windows.Data.Json.IJsonValue[]): number; - lastIndexOf(searchElement: Windows.Data.Json.IJsonValue): number; - lastIndexOf(searchElement: Windows.Data.Json.IJsonValue, fromIndex: number): number; - every(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => boolean): boolean; - every(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => boolean): boolean; - some(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => void ): void; - forEach(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => void , thisArg: any): void; - map(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => any): any[]; - map(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => boolean): Windows.Data.Json.IJsonValue[]; - filter(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => boolean, thisArg: any): Windows.Data.Json.IJsonValue[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Json.IJsonValue[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Json.IJsonValue[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Json.IJsonValue[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Json.IJsonValue[]) => any, initialValue: any): any; - length: number; - } - export class JsonObject implements Windows.Data.Json.IJsonObject, Windows.Data.Json.IJsonValue, Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { - valueType: Windows.Data.Json.JsonValueType; - size: number; - getNamedValue(name: string): Windows.Data.Json.JsonValue; - setNamedValue(name: string, value: Windows.Data.Json.IJsonValue): void; - getNamedObject(name: string): Windows.Data.Json.JsonObject; - getNamedArray(name: string): Windows.Data.Json.JsonArray; - getNamedString(name: string): string; - getNamedNumber(name: string): number; - getNamedBoolean(name: string): boolean; - stringify(): string; - getString(): string; - getNumber(): number; - getBoolean(): boolean; - getArray(): Windows.Data.Json.JsonArray; - getObject(): Windows.Data.Json.JsonObject; - lookup(key: string): Windows.Data.Json.IJsonValue; - hasKey(key: string): boolean; - getView(): Windows.Foundation.Collections.IMapView; - insert(key: string, value: Windows.Data.Json.IJsonValue): boolean; - remove(key: string): void; - clear(): void; - first(): Windows.Foundation.Collections.IIterator>; - static parse(input: string): Windows.Data.Json.JsonObject; - static tryParse(input: string): { result: Windows.Data.Json.JsonObject; succeeded: boolean; }; - } - export interface IJsonValueStatics { - parse(input: string): Windows.Data.Json.JsonValue; - tryParse(input: string): { result: Windows.Data.Json.JsonValue; succeeded: boolean; }; - createBooleanValue(input: boolean): Windows.Data.Json.JsonValue; - createNumberValue(input: number): Windows.Data.Json.JsonValue; - createStringValue(input: string): Windows.Data.Json.JsonValue; - } - export class JsonValue implements Windows.Data.Json.IJsonValue { - valueType: Windows.Data.Json.JsonValueType; - stringify(): string; - getString(): string; - getNumber(): number; - getBoolean(): boolean; - getArray(): Windows.Data.Json.JsonArray; - getObject(): Windows.Data.Json.JsonObject; - static parse(input: string): Windows.Data.Json.JsonValue; - static tryParse(input: string): { result: Windows.Data.Json.JsonValue; succeeded: boolean; }; - static createBooleanValue(input: boolean): Windows.Data.Json.JsonValue; - static createNumberValue(input: number): Windows.Data.Json.JsonValue; - static createStringValue(input: string): Windows.Data.Json.JsonValue; - } - export interface IJsonObject extends Windows.Data.Json.IJsonValue { - getNamedValue(name: string): Windows.Data.Json.JsonValue; - setNamedValue(name: string, value: Windows.Data.Json.IJsonValue): void; - getNamedObject(name: string): Windows.Data.Json.JsonObject; - getNamedArray(name: string): Windows.Data.Json.JsonArray; - getNamedString(name: string): string; - getNamedNumber(name: string): number; - getNamedBoolean(name: string): boolean; - } - export interface IJsonObjectStatics { - parse(input: string): Windows.Data.Json.JsonObject; - tryParse(input: string): { result: Windows.Data.Json.JsonObject; succeeded: boolean; }; - } - export interface IJsonArray extends Windows.Data.Json.IJsonValue { - getObjectAt(index: number): Windows.Data.Json.JsonObject; - getArrayAt(index: number): Windows.Data.Json.JsonArray; - getStringAt(index: number): string; - getNumberAt(index: number): number; - getBooleanAt(index: number): boolean; - } - export interface IJsonArrayStatics { - parse(input: string): Windows.Data.Json.JsonArray; - tryParse(input: string): { result: Windows.Data.Json.JsonArray; succeeded: boolean; }; - } - export interface IJsonErrorStatics { - getStatus(hresult: number): Windows.Data.Json.JsonErrorStatus; - } - export class JsonError { - static getStatus(hresult: number): Windows.Data.Json.JsonErrorStatus; - } - } - } -} -declare module Windows { - export module Data { - export module Xml { - export module Dom { - export enum NodeType { - invalid, - elementNode, - attributeNode, - textNode, - dataSectionNode, - entityReferenceNode, - entityNode, - processingInstructionNode, - commentNode, - documentNode, - documentTypeNode, - documentFragmentNode, - notationNode, - } - export interface IXmlNodeSelector { - selectSingleNode(xpath: string): Windows.Data.Xml.Dom.IXmlNode; - selectNodes(xpath: string): Windows.Data.Xml.Dom.XmlNodeList; - selectSingleNodeNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.IXmlNode; - selectNodesNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.XmlNodeList; - } - export class XmlNodeList implements Windows.Data.Xml.Dom.IXmlNodeList, Windows.Foundation.Collections.IVectorView, Windows.Foundation.Collections.IIterable { - length: number; - size: number; - item(index: number): Windows.Data.Xml.Dom.IXmlNode; - getAt(index: number): Windows.Data.Xml.Dom.IXmlNode; - indexOf(value: Windows.Data.Xml.Dom.IXmlNode): { index: number; returnValue: boolean; }; - getMany(startIndex: number): { items: Windows.Data.Xml.Dom.IXmlNode[]; returnValue: number; }; - first(): Windows.Foundation.Collections.IIterator; - toString(): string; - toLocaleString(): string; - concat(...items: Windows.Data.Xml.Dom.IXmlNode[][]): Windows.Data.Xml.Dom.IXmlNode[]; - join(seperator: string): string; - pop(): Windows.Data.Xml.Dom.IXmlNode; - push(...items: Windows.Data.Xml.Dom.IXmlNode[]): void; - reverse(): Windows.Data.Xml.Dom.IXmlNode[]; - shift(): Windows.Data.Xml.Dom.IXmlNode; - slice(start: number): Windows.Data.Xml.Dom.IXmlNode[]; - slice(start: number, end: number): Windows.Data.Xml.Dom.IXmlNode[]; - sort(): Windows.Data.Xml.Dom.IXmlNode[]; - sort(compareFn: (a: Windows.Data.Xml.Dom.IXmlNode, b: Windows.Data.Xml.Dom.IXmlNode) => number): Windows.Data.Xml.Dom.IXmlNode[]; - splice(start: number): Windows.Data.Xml.Dom.IXmlNode[]; - splice(start: number, deleteCount: number, ...items: Windows.Data.Xml.Dom.IXmlNode[]): Windows.Data.Xml.Dom.IXmlNode[]; - unshift(...items: Windows.Data.Xml.Dom.IXmlNode[]): number; - lastIndexOf(searchElement: Windows.Data.Xml.Dom.IXmlNode): number; - lastIndexOf(searchElement: Windows.Data.Xml.Dom.IXmlNode, fromIndex: number): number; - every(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean): boolean; - every(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean): boolean; - some(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => void ): void; - forEach(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => void , thisArg: any): void; - map(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any): any[]; - map(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean): Windows.Data.Xml.Dom.IXmlNode[]; - filter(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean, thisArg: any): Windows.Data.Xml.Dom.IXmlNode[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any, initialValue: any): any; - } - export class XmlNamedNodeMap implements Windows.Data.Xml.Dom.IXmlNamedNodeMap, Windows.Foundation.Collections.IVectorView, Windows.Foundation.Collections.IIterable { - length: number; - size: number; - item(index: number): Windows.Data.Xml.Dom.IXmlNode; - getNamedItem(name: string): Windows.Data.Xml.Dom.IXmlNode; - setNamedItem(node: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeNamedItem(name: string): Windows.Data.Xml.Dom.IXmlNode; - getNamedItemNS(namespaceUri: any, name: string): Windows.Data.Xml.Dom.IXmlNode; - removeNamedItemNS(namespaceUri: any, name: string): Windows.Data.Xml.Dom.IXmlNode; - setNamedItemNS(node: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - getAt(index: number): Windows.Data.Xml.Dom.IXmlNode; - indexOf(value: Windows.Data.Xml.Dom.IXmlNode): { index: number; returnValue: boolean; }; - getMany(startIndex: number): { items: Windows.Data.Xml.Dom.IXmlNode[]; returnValue: number; }; - first(): Windows.Foundation.Collections.IIterator; - toString(): string; - toLocaleString(): string; - concat(...items: Windows.Data.Xml.Dom.IXmlNode[][]): Windows.Data.Xml.Dom.IXmlNode[]; - join(seperator: string): string; - pop(): Windows.Data.Xml.Dom.IXmlNode; - push(...items: Windows.Data.Xml.Dom.IXmlNode[]): void; - reverse(): Windows.Data.Xml.Dom.IXmlNode[]; - shift(): Windows.Data.Xml.Dom.IXmlNode; - slice(start: number): Windows.Data.Xml.Dom.IXmlNode[]; - slice(start: number, end: number): Windows.Data.Xml.Dom.IXmlNode[]; - sort(): Windows.Data.Xml.Dom.IXmlNode[]; - sort(compareFn: (a: Windows.Data.Xml.Dom.IXmlNode, b: Windows.Data.Xml.Dom.IXmlNode) => number): Windows.Data.Xml.Dom.IXmlNode[]; - splice(start: number): Windows.Data.Xml.Dom.IXmlNode[]; - splice(start: number, deleteCount: number, ...items: Windows.Data.Xml.Dom.IXmlNode[]): Windows.Data.Xml.Dom.IXmlNode[]; - unshift(...items: Windows.Data.Xml.Dom.IXmlNode[]): number; - lastIndexOf(searchElement: Windows.Data.Xml.Dom.IXmlNode): number; - lastIndexOf(searchElement: Windows.Data.Xml.Dom.IXmlNode, fromIndex: number): number; - every(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean): boolean; - every(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean): boolean; - some(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => void ): void; - forEach(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => void , thisArg: any): void; - map(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any): any[]; - map(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean): Windows.Data.Xml.Dom.IXmlNode[]; - filter(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean, thisArg: any): Windows.Data.Xml.Dom.IXmlNode[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any, initialValue: any): any; - } - export class XmlDocument implements Windows.Data.Xml.Dom.IXmlDocument, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer, Windows.Data.Xml.Dom.IXmlDocumentIO { - doctype: Windows.Data.Xml.Dom.XmlDocumentType; - documentElement: Windows.Data.Xml.Dom.XmlElement; - documentUri: string; - implementation: Windows.Data.Xml.Dom.XmlDomImplementation; - attributes: Windows.Data.Xml.Dom.XmlNamedNodeMap; - childNodes: Windows.Data.Xml.Dom.XmlNodeList; - firstChild: Windows.Data.Xml.Dom.IXmlNode; - lastChild: Windows.Data.Xml.Dom.IXmlNode; - localName: any; - namespaceUri: any; - nextSibling: Windows.Data.Xml.Dom.IXmlNode; - nodeName: string; - nodeType: Windows.Data.Xml.Dom.NodeType; - nodeValue: any; - ownerDocument: Windows.Data.Xml.Dom.XmlDocument; - parentNode: Windows.Data.Xml.Dom.IXmlNode; - prefix: any; - previousSibling: Windows.Data.Xml.Dom.IXmlNode; - innerText: string; - createElement(tagName: string): Windows.Data.Xml.Dom.XmlElement; - createDocumentFragment(): Windows.Data.Xml.Dom.XmlDocumentFragment; - createTextNode(data: string): Windows.Data.Xml.Dom.XmlText; - createComment(data: string): Windows.Data.Xml.Dom.XmlComment; - createProcessingInstruction(target: string, data: string): Windows.Data.Xml.Dom.XmlProcessingInstruction; - createAttribute(name: string): Windows.Data.Xml.Dom.XmlAttribute; - createEntityReference(name: string): Windows.Data.Xml.Dom.XmlEntityReference; - getElementsByTagName(tagName: string): Windows.Data.Xml.Dom.XmlNodeList; - createCDataSection(data: string): Windows.Data.Xml.Dom.XmlCDataSection; - createAttributeNS(namespaceUri: any, qualifiedName: string): Windows.Data.Xml.Dom.XmlAttribute; - createElementNS(namespaceUri: any, qualifiedName: string): Windows.Data.Xml.Dom.XmlElement; - getElementById(elementId: string): Windows.Data.Xml.Dom.XmlElement; - importNode(node: Windows.Data.Xml.Dom.IXmlNode, deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - hasChildNodes(): boolean; - insertBefore(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - replaceChild(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeChild(childNode: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - appendChild(newChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - cloneNode(deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - normalize(): void; - selectSingleNode(xpath: string): Windows.Data.Xml.Dom.IXmlNode; - selectNodes(xpath: string): Windows.Data.Xml.Dom.XmlNodeList; - selectSingleNodeNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.IXmlNode; - selectNodesNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.XmlNodeList; - getXml(): string; - loadXml(xml: string): void; - loadXml(xml: string, loadSettings: Windows.Data.Xml.Dom.XmlLoadSettings): void; - saveToFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - static loadFromUriAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation; - static loadFromUriAsync(uri: Windows.Foundation.Uri, loadSettings: Windows.Data.Xml.Dom.XmlLoadSettings): Windows.Foundation.IAsyncOperation; - static loadFromFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - static loadFromFileAsync(file: Windows.Storage.IStorageFile, loadSettings: Windows.Data.Xml.Dom.XmlLoadSettings): Windows.Foundation.IAsyncOperation; - } - export interface IXmlNodeSerializer { - innerText: string; - getXml(): string; - } - export interface IXmlNode extends Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - attributes: Windows.Data.Xml.Dom.XmlNamedNodeMap; - childNodes: Windows.Data.Xml.Dom.XmlNodeList; - firstChild: Windows.Data.Xml.Dom.IXmlNode; - lastChild: Windows.Data.Xml.Dom.IXmlNode; - localName: any; - namespaceUri: any; - nextSibling: Windows.Data.Xml.Dom.IXmlNode; - nodeName: string; - nodeType: Windows.Data.Xml.Dom.NodeType; - nodeValue: any; - ownerDocument: Windows.Data.Xml.Dom.XmlDocument; - parentNode: Windows.Data.Xml.Dom.IXmlNode; - prefix: any; - previousSibling: Windows.Data.Xml.Dom.IXmlNode; - hasChildNodes(): boolean; - insertBefore(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - replaceChild(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeChild(childNode: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - appendChild(newChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - cloneNode(deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - normalize(): void; - } - export interface IXmlDomImplementation { - hasFeature(feature: string, version: any): boolean; - } - export interface IXmlDocumentType extends Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - entities: Windows.Data.Xml.Dom.XmlNamedNodeMap; - name: string; - notations: Windows.Data.Xml.Dom.XmlNamedNodeMap; - } - export interface IXmlAttribute extends Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - name: string; - specified: boolean; - value: string; - } - export interface IXmlDocumentFragment extends Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - } - export interface IXmlElement extends Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - tagName: string; - getAttribute(attributeName: string): string; - setAttribute(attributeName: string, attributeValue: string): void; - removeAttribute(attributeName: string): void; - getAttributeNode(attributeName: string): Windows.Data.Xml.Dom.XmlAttribute; - setAttributeNode(newAttribute: Windows.Data.Xml.Dom.XmlAttribute): Windows.Data.Xml.Dom.XmlAttribute; - removeAttributeNode(attributeNode: Windows.Data.Xml.Dom.XmlAttribute): Windows.Data.Xml.Dom.XmlAttribute; - getElementsByTagName(tagName: string): Windows.Data.Xml.Dom.XmlNodeList; - setAttributeNS(namespaceUri: any, qualifiedName: string, value: string): void; - getAttributeNS(namespaceUri: any, localName: string): string; - removeAttributeNS(namespaceUri: any, localName: string): void; - setAttributeNodeNS(newAttribute: Windows.Data.Xml.Dom.XmlAttribute): Windows.Data.Xml.Dom.XmlAttribute; - getAttributeNodeNS(namespaceUri: any, localName: string): Windows.Data.Xml.Dom.XmlAttribute; - } - export class XmlAttribute implements Windows.Data.Xml.Dom.IXmlAttribute, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - name: string; - specified: boolean; - value: string; - attributes: Windows.Data.Xml.Dom.XmlNamedNodeMap; - childNodes: Windows.Data.Xml.Dom.XmlNodeList; - firstChild: Windows.Data.Xml.Dom.IXmlNode; - lastChild: Windows.Data.Xml.Dom.IXmlNode; - localName: any; - namespaceUri: any; - nextSibling: Windows.Data.Xml.Dom.IXmlNode; - nodeName: string; - nodeType: Windows.Data.Xml.Dom.NodeType; - nodeValue: any; - ownerDocument: Windows.Data.Xml.Dom.XmlDocument; - parentNode: Windows.Data.Xml.Dom.IXmlNode; - prefix: any; - previousSibling: Windows.Data.Xml.Dom.IXmlNode; - innerText: string; - hasChildNodes(): boolean; - insertBefore(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - replaceChild(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeChild(childNode: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - appendChild(newChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - cloneNode(deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - normalize(): void; - selectSingleNode(xpath: string): Windows.Data.Xml.Dom.IXmlNode; - selectNodes(xpath: string): Windows.Data.Xml.Dom.XmlNodeList; - selectSingleNodeNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.IXmlNode; - selectNodesNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.XmlNodeList; - getXml(): string; - } - export interface IDtdNotation extends Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - publicId: any; - systemId: any; - } - export interface IDtdEntity extends Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - notationName: any; - publicId: any; - systemId: any; - } - export interface IXmlEntityReference extends Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - } - export interface IXmlProcessingInstruction extends Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - data: string; - target: string; - } - export interface IXmlCharacterData extends Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - data: string; - length: number; - substringData(offset: number, count: number): string; - appendData(data: string): void; - insertData(offset: number, data: string): void; - deleteData(offset: number, count: number): void; - replaceData(offset: number, count: number, data: string): void; - } - export interface IXmlComment extends Windows.Data.Xml.Dom.IXmlCharacterData, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - } - export interface IXmlText extends Windows.Data.Xml.Dom.IXmlCharacterData, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - splitText(offset: number): Windows.Data.Xml.Dom.IXmlText; - } - export interface IXmlCDataSection extends Windows.Data.Xml.Dom.IXmlText, Windows.Data.Xml.Dom.IXmlCharacterData, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - } - export interface IXmlDocument extends Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - doctype: Windows.Data.Xml.Dom.XmlDocumentType; - documentElement: Windows.Data.Xml.Dom.XmlElement; - documentUri: string; - implementation: Windows.Data.Xml.Dom.XmlDomImplementation; - createElement(tagName: string): Windows.Data.Xml.Dom.XmlElement; - createDocumentFragment(): Windows.Data.Xml.Dom.XmlDocumentFragment; - createTextNode(data: string): Windows.Data.Xml.Dom.XmlText; - createComment(data: string): Windows.Data.Xml.Dom.XmlComment; - createProcessingInstruction(target: string, data: string): Windows.Data.Xml.Dom.XmlProcessingInstruction; - createAttribute(name: string): Windows.Data.Xml.Dom.XmlAttribute; - createEntityReference(name: string): Windows.Data.Xml.Dom.XmlEntityReference; - getElementsByTagName(tagName: string): Windows.Data.Xml.Dom.XmlNodeList; - createCDataSection(data: string): Windows.Data.Xml.Dom.XmlCDataSection; - createAttributeNS(namespaceUri: any, qualifiedName: string): Windows.Data.Xml.Dom.XmlAttribute; - createElementNS(namespaceUri: any, qualifiedName: string): Windows.Data.Xml.Dom.XmlElement; - getElementById(elementId: string): Windows.Data.Xml.Dom.XmlElement; - importNode(node: Windows.Data.Xml.Dom.IXmlNode, deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - } - export class XmlDocumentType implements Windows.Data.Xml.Dom.IXmlDocumentType, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - entities: Windows.Data.Xml.Dom.XmlNamedNodeMap; - name: string; - notations: Windows.Data.Xml.Dom.XmlNamedNodeMap; - attributes: Windows.Data.Xml.Dom.XmlNamedNodeMap; - childNodes: Windows.Data.Xml.Dom.XmlNodeList; - firstChild: Windows.Data.Xml.Dom.IXmlNode; - lastChild: Windows.Data.Xml.Dom.IXmlNode; - localName: any; - namespaceUri: any; - nextSibling: Windows.Data.Xml.Dom.IXmlNode; - nodeName: string; - nodeType: Windows.Data.Xml.Dom.NodeType; - nodeValue: any; - ownerDocument: Windows.Data.Xml.Dom.XmlDocument; - parentNode: Windows.Data.Xml.Dom.IXmlNode; - prefix: any; - previousSibling: Windows.Data.Xml.Dom.IXmlNode; - innerText: string; - hasChildNodes(): boolean; - insertBefore(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - replaceChild(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeChild(childNode: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - appendChild(newChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - cloneNode(deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - normalize(): void; - selectSingleNode(xpath: string): Windows.Data.Xml.Dom.IXmlNode; - selectNodes(xpath: string): Windows.Data.Xml.Dom.XmlNodeList; - selectSingleNodeNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.IXmlNode; - selectNodesNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.XmlNodeList; - getXml(): string; - } - export class XmlDomImplementation implements Windows.Data.Xml.Dom.IXmlDomImplementation { - hasFeature(feature: string, version: any): boolean; - } - export class XmlElement implements Windows.Data.Xml.Dom.IXmlElement, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - tagName: string; - attributes: Windows.Data.Xml.Dom.XmlNamedNodeMap; - childNodes: Windows.Data.Xml.Dom.XmlNodeList; - firstChild: Windows.Data.Xml.Dom.IXmlNode; - lastChild: Windows.Data.Xml.Dom.IXmlNode; - localName: any; - namespaceUri: any; - nextSibling: Windows.Data.Xml.Dom.IXmlNode; - nodeName: string; - nodeType: Windows.Data.Xml.Dom.NodeType; - nodeValue: any; - ownerDocument: Windows.Data.Xml.Dom.XmlDocument; - parentNode: Windows.Data.Xml.Dom.IXmlNode; - prefix: any; - previousSibling: Windows.Data.Xml.Dom.IXmlNode; - innerText: string; - getAttribute(attributeName: string): string; - setAttribute(attributeName: string, attributeValue: string): void; - removeAttribute(attributeName: string): void; - getAttributeNode(attributeName: string): Windows.Data.Xml.Dom.XmlAttribute; - setAttributeNode(newAttribute: Windows.Data.Xml.Dom.XmlAttribute): Windows.Data.Xml.Dom.XmlAttribute; - removeAttributeNode(attributeNode: Windows.Data.Xml.Dom.XmlAttribute): Windows.Data.Xml.Dom.XmlAttribute; - getElementsByTagName(tagName: string): Windows.Data.Xml.Dom.XmlNodeList; - setAttributeNS(namespaceUri: any, qualifiedName: string, value: string): void; - getAttributeNS(namespaceUri: any, localName: string): string; - removeAttributeNS(namespaceUri: any, localName: string): void; - setAttributeNodeNS(newAttribute: Windows.Data.Xml.Dom.XmlAttribute): Windows.Data.Xml.Dom.XmlAttribute; - getAttributeNodeNS(namespaceUri: any, localName: string): Windows.Data.Xml.Dom.XmlAttribute; - hasChildNodes(): boolean; - insertBefore(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - replaceChild(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeChild(childNode: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - appendChild(newChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - cloneNode(deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - normalize(): void; - selectSingleNode(xpath: string): Windows.Data.Xml.Dom.IXmlNode; - selectNodes(xpath: string): Windows.Data.Xml.Dom.XmlNodeList; - selectSingleNodeNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.IXmlNode; - selectNodesNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.XmlNodeList; - getXml(): string; - } - export class XmlDocumentFragment implements Windows.Data.Xml.Dom.IXmlDocumentFragment, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - attributes: Windows.Data.Xml.Dom.XmlNamedNodeMap; - childNodes: Windows.Data.Xml.Dom.XmlNodeList; - firstChild: Windows.Data.Xml.Dom.IXmlNode; - lastChild: Windows.Data.Xml.Dom.IXmlNode; - localName: any; - namespaceUri: any; - nextSibling: Windows.Data.Xml.Dom.IXmlNode; - nodeName: string; - nodeType: Windows.Data.Xml.Dom.NodeType; - nodeValue: any; - ownerDocument: Windows.Data.Xml.Dom.XmlDocument; - parentNode: Windows.Data.Xml.Dom.IXmlNode; - prefix: any; - previousSibling: Windows.Data.Xml.Dom.IXmlNode; - innerText: string; - hasChildNodes(): boolean; - insertBefore(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - replaceChild(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeChild(childNode: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - appendChild(newChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - cloneNode(deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - normalize(): void; - selectSingleNode(xpath: string): Windows.Data.Xml.Dom.IXmlNode; - selectNodes(xpath: string): Windows.Data.Xml.Dom.XmlNodeList; - selectSingleNodeNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.IXmlNode; - selectNodesNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.XmlNodeList; - getXml(): string; - } - export class XmlText implements Windows.Data.Xml.Dom.IXmlText, Windows.Data.Xml.Dom.IXmlCharacterData, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - data: string; - length: number; - attributes: Windows.Data.Xml.Dom.XmlNamedNodeMap; - childNodes: Windows.Data.Xml.Dom.XmlNodeList; - firstChild: Windows.Data.Xml.Dom.IXmlNode; - lastChild: Windows.Data.Xml.Dom.IXmlNode; - localName: any; - namespaceUri: any; - nextSibling: Windows.Data.Xml.Dom.IXmlNode; - nodeName: string; - nodeType: Windows.Data.Xml.Dom.NodeType; - nodeValue: any; - ownerDocument: Windows.Data.Xml.Dom.XmlDocument; - parentNode: Windows.Data.Xml.Dom.IXmlNode; - prefix: any; - previousSibling: Windows.Data.Xml.Dom.IXmlNode; - innerText: string; - splitText(offset: number): Windows.Data.Xml.Dom.IXmlText; - substringData(offset: number, count: number): string; - appendData(data: string): void; - insertData(offset: number, data: string): void; - deleteData(offset: number, count: number): void; - replaceData(offset: number, count: number, data: string): void; - hasChildNodes(): boolean; - insertBefore(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - replaceChild(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeChild(childNode: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - appendChild(newChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - cloneNode(deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - normalize(): void; - selectSingleNode(xpath: string): Windows.Data.Xml.Dom.IXmlNode; - selectNodes(xpath: string): Windows.Data.Xml.Dom.XmlNodeList; - selectSingleNodeNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.IXmlNode; - selectNodesNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.XmlNodeList; - getXml(): string; - } - export class XmlComment implements Windows.Data.Xml.Dom.IXmlComment, Windows.Data.Xml.Dom.IXmlCharacterData, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - data: string; - length: number; - attributes: Windows.Data.Xml.Dom.XmlNamedNodeMap; - childNodes: Windows.Data.Xml.Dom.XmlNodeList; - firstChild: Windows.Data.Xml.Dom.IXmlNode; - lastChild: Windows.Data.Xml.Dom.IXmlNode; - localName: any; - namespaceUri: any; - nextSibling: Windows.Data.Xml.Dom.IXmlNode; - nodeName: string; - nodeType: Windows.Data.Xml.Dom.NodeType; - nodeValue: any; - ownerDocument: Windows.Data.Xml.Dom.XmlDocument; - parentNode: Windows.Data.Xml.Dom.IXmlNode; - prefix: any; - previousSibling: Windows.Data.Xml.Dom.IXmlNode; - innerText: string; - substringData(offset: number, count: number): string; - appendData(data: string): void; - insertData(offset: number, data: string): void; - deleteData(offset: number, count: number): void; - replaceData(offset: number, count: number, data: string): void; - hasChildNodes(): boolean; - insertBefore(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - replaceChild(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeChild(childNode: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - appendChild(newChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - cloneNode(deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - normalize(): void; - selectSingleNode(xpath: string): Windows.Data.Xml.Dom.IXmlNode; - selectNodes(xpath: string): Windows.Data.Xml.Dom.XmlNodeList; - selectSingleNodeNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.IXmlNode; - selectNodesNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.XmlNodeList; - getXml(): string; - } - export class XmlProcessingInstruction implements Windows.Data.Xml.Dom.IXmlProcessingInstruction, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - data: string; - target: string; - attributes: Windows.Data.Xml.Dom.XmlNamedNodeMap; - childNodes: Windows.Data.Xml.Dom.XmlNodeList; - firstChild: Windows.Data.Xml.Dom.IXmlNode; - lastChild: Windows.Data.Xml.Dom.IXmlNode; - localName: any; - namespaceUri: any; - nextSibling: Windows.Data.Xml.Dom.IXmlNode; - nodeName: string; - nodeType: Windows.Data.Xml.Dom.NodeType; - nodeValue: any; - ownerDocument: Windows.Data.Xml.Dom.XmlDocument; - parentNode: Windows.Data.Xml.Dom.IXmlNode; - prefix: any; - previousSibling: Windows.Data.Xml.Dom.IXmlNode; - innerText: string; - hasChildNodes(): boolean; - insertBefore(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - replaceChild(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeChild(childNode: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - appendChild(newChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - cloneNode(deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - normalize(): void; - selectSingleNode(xpath: string): Windows.Data.Xml.Dom.IXmlNode; - selectNodes(xpath: string): Windows.Data.Xml.Dom.XmlNodeList; - selectSingleNodeNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.IXmlNode; - selectNodesNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.XmlNodeList; - getXml(): string; - } - export class XmlEntityReference implements Windows.Data.Xml.Dom.IXmlEntityReference, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - attributes: Windows.Data.Xml.Dom.XmlNamedNodeMap; - childNodes: Windows.Data.Xml.Dom.XmlNodeList; - firstChild: Windows.Data.Xml.Dom.IXmlNode; - lastChild: Windows.Data.Xml.Dom.IXmlNode; - localName: any; - namespaceUri: any; - nextSibling: Windows.Data.Xml.Dom.IXmlNode; - nodeName: string; - nodeType: Windows.Data.Xml.Dom.NodeType; - nodeValue: any; - ownerDocument: Windows.Data.Xml.Dom.XmlDocument; - parentNode: Windows.Data.Xml.Dom.IXmlNode; - prefix: any; - previousSibling: Windows.Data.Xml.Dom.IXmlNode; - innerText: string; - hasChildNodes(): boolean; - insertBefore(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - replaceChild(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeChild(childNode: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - appendChild(newChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - cloneNode(deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - normalize(): void; - selectSingleNode(xpath: string): Windows.Data.Xml.Dom.IXmlNode; - selectNodes(xpath: string): Windows.Data.Xml.Dom.XmlNodeList; - selectSingleNodeNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.IXmlNode; - selectNodesNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.XmlNodeList; - getXml(): string; - } - export class XmlCDataSection implements Windows.Data.Xml.Dom.IXmlCDataSection, Windows.Data.Xml.Dom.IXmlText, Windows.Data.Xml.Dom.IXmlCharacterData, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - data: string; - length: number; - attributes: Windows.Data.Xml.Dom.XmlNamedNodeMap; - childNodes: Windows.Data.Xml.Dom.XmlNodeList; - firstChild: Windows.Data.Xml.Dom.IXmlNode; - lastChild: Windows.Data.Xml.Dom.IXmlNode; - localName: any; - namespaceUri: any; - nextSibling: Windows.Data.Xml.Dom.IXmlNode; - nodeName: string; - nodeType: Windows.Data.Xml.Dom.NodeType; - nodeValue: any; - ownerDocument: Windows.Data.Xml.Dom.XmlDocument; - parentNode: Windows.Data.Xml.Dom.IXmlNode; - prefix: any; - previousSibling: Windows.Data.Xml.Dom.IXmlNode; - innerText: string; - splitText(offset: number): Windows.Data.Xml.Dom.IXmlText; - substringData(offset: number, count: number): string; - appendData(data: string): void; - insertData(offset: number, data: string): void; - deleteData(offset: number, count: number): void; - replaceData(offset: number, count: number, data: string): void; - hasChildNodes(): boolean; - insertBefore(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - replaceChild(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeChild(childNode: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - appendChild(newChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - cloneNode(deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - normalize(): void; - selectSingleNode(xpath: string): Windows.Data.Xml.Dom.IXmlNode; - selectNodes(xpath: string): Windows.Data.Xml.Dom.XmlNodeList; - selectSingleNodeNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.IXmlNode; - selectNodesNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.XmlNodeList; - getXml(): string; - } - export interface IXmlNamedNodeMap extends Windows.Foundation.Collections.IVectorView, Windows.Foundation.Collections.IIterable { - length: number; - item(index: number): Windows.Data.Xml.Dom.IXmlNode; - getNamedItem(name: string): Windows.Data.Xml.Dom.IXmlNode; - setNamedItem(node: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeNamedItem(name: string): Windows.Data.Xml.Dom.IXmlNode; - getNamedItemNS(namespaceUri: any, name: string): Windows.Data.Xml.Dom.IXmlNode; - removeNamedItemNS(namespaceUri: any, name: string): Windows.Data.Xml.Dom.IXmlNode; - setNamedItemNS(node: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - } - export interface IXmlNodeList extends Windows.Foundation.Collections.IVectorView, Windows.Foundation.Collections.IIterable { - length: number; - item(index: number): Windows.Data.Xml.Dom.IXmlNode; - } - export interface IXmlLoadSettings { - elementContentWhiteSpace: boolean; - maxElementDepth: number; - prohibitDtd: boolean; - resolveExternals: boolean; - validateOnParse: boolean; - } - export interface IXmlDocumentIO { - loadXml(xml: string): void; - loadXml(xml: string, loadSettings: Windows.Data.Xml.Dom.XmlLoadSettings): void; - saveToFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - } - export class XmlLoadSettings implements Windows.Data.Xml.Dom.IXmlLoadSettings { - elementContentWhiteSpace: boolean; - maxElementDepth: number; - prohibitDtd: boolean; - resolveExternals: boolean; - validateOnParse: boolean; - } - export interface IXmlDocumentStatics { - loadFromUriAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation; - loadFromUriAsync(uri: Windows.Foundation.Uri, loadSettings: Windows.Data.Xml.Dom.XmlLoadSettings): Windows.Foundation.IAsyncOperation; - loadFromFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - loadFromFileAsync(file: Windows.Storage.IStorageFile, loadSettings: Windows.Data.Xml.Dom.XmlLoadSettings): Windows.Foundation.IAsyncOperation; - } - export class DtdNotation implements Windows.Data.Xml.Dom.IDtdNotation, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - publicId: any; - systemId: any; - attributes: Windows.Data.Xml.Dom.XmlNamedNodeMap; - childNodes: Windows.Data.Xml.Dom.XmlNodeList; - firstChild: Windows.Data.Xml.Dom.IXmlNode; - lastChild: Windows.Data.Xml.Dom.IXmlNode; - localName: any; - namespaceUri: any; - nextSibling: Windows.Data.Xml.Dom.IXmlNode; - nodeName: string; - nodeType: Windows.Data.Xml.Dom.NodeType; - nodeValue: any; - ownerDocument: Windows.Data.Xml.Dom.XmlDocument; - parentNode: Windows.Data.Xml.Dom.IXmlNode; - prefix: any; - previousSibling: Windows.Data.Xml.Dom.IXmlNode; - innerText: string; - hasChildNodes(): boolean; - insertBefore(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - replaceChild(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeChild(childNode: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - appendChild(newChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - cloneNode(deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - normalize(): void; - selectSingleNode(xpath: string): Windows.Data.Xml.Dom.IXmlNode; - selectNodes(xpath: string): Windows.Data.Xml.Dom.XmlNodeList; - selectSingleNodeNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.IXmlNode; - selectNodesNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.XmlNodeList; - getXml(): string; - } - export class DtdEntity implements Windows.Data.Xml.Dom.IDtdEntity, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer { - notationName: any; - publicId: any; - systemId: any; - attributes: Windows.Data.Xml.Dom.XmlNamedNodeMap; - childNodes: Windows.Data.Xml.Dom.XmlNodeList; - firstChild: Windows.Data.Xml.Dom.IXmlNode; - lastChild: Windows.Data.Xml.Dom.IXmlNode; - localName: any; - namespaceUri: any; - nextSibling: Windows.Data.Xml.Dom.IXmlNode; - nodeName: string; - nodeType: Windows.Data.Xml.Dom.NodeType; - nodeValue: any; - ownerDocument: Windows.Data.Xml.Dom.XmlDocument; - parentNode: Windows.Data.Xml.Dom.IXmlNode; - prefix: any; - previousSibling: Windows.Data.Xml.Dom.IXmlNode; - innerText: string; - hasChildNodes(): boolean; - insertBefore(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - replaceChild(newChild: Windows.Data.Xml.Dom.IXmlNode, referenceChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - removeChild(childNode: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - appendChild(newChild: Windows.Data.Xml.Dom.IXmlNode): Windows.Data.Xml.Dom.IXmlNode; - cloneNode(deep: boolean): Windows.Data.Xml.Dom.IXmlNode; - normalize(): void; - selectSingleNode(xpath: string): Windows.Data.Xml.Dom.IXmlNode; - selectNodes(xpath: string): Windows.Data.Xml.Dom.XmlNodeList; - selectSingleNodeNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.IXmlNode; - selectNodesNS(xpath: string, namespaces: any): Windows.Data.Xml.Dom.XmlNodeList; - getXml(): string; - } - } - } - } -} -declare module Windows { - export module Data { - export module Xml { - export module Xsl { - export interface IXsltProcessor { - transformToString(inputNode: Windows.Data.Xml.Dom.IXmlNode): string; - } - export interface IXsltProcessorFactory { - createInstance(document: Windows.Data.Xml.Dom.XmlDocument): Windows.Data.Xml.Xsl.XsltProcessor; - } - export class XsltProcessor implements Windows.Data.Xml.Xsl.IXsltProcessor { - constructor(document: Windows.Data.Xml.Dom.XmlDocument); - transformToString(inputNode: Windows.Data.Xml.Dom.IXmlNode): string; - } - } - } - } -} -declare module Windows { - export module Devices { - export module Sms { - export enum SmsMessageClass { - none, - class0, - class1, - class2, - class3, - } - export interface ISmsMessage { - id: number; - messageClass: Windows.Devices.Sms.SmsMessageClass; - } - export enum SmsDataFormat { - unknown, - cdmaSubmit, - gsmSubmit, - cdmaDeliver, - gsmDeliver, - } - export interface ISmsBinaryMessage extends Windows.Devices.Sms.ISmsMessage { - format: Windows.Devices.Sms.SmsDataFormat; - getData(): Uint8Array; - setData(value: Uint8Array): void; - } - export class SmsBinaryMessage implements Windows.Devices.Sms.ISmsBinaryMessage, Windows.Devices.Sms.ISmsMessage { - format: Windows.Devices.Sms.SmsDataFormat; - id: number; - messageClass: Windows.Devices.Sms.SmsMessageClass; - getData(): Uint8Array; - setData(value: Uint8Array): void; - } - export enum SmsEncoding { - unknown, - optimal, - sevenBitAscii, - unicode, - gsmSevenBit, - } - export interface ISmsTextMessage extends Windows.Devices.Sms.ISmsMessage { - body: string; - encoding: Windows.Devices.Sms.SmsEncoding; - from: string; - partCount: number; - partNumber: number; - partReferenceId: number; - timestamp: Date; - to: string; - toBinaryMessages(format: Windows.Devices.Sms.SmsDataFormat): Windows.Foundation.Collections.IVectorView; - } - export interface ISmsTextMessageStatics { - fromBinaryMessage(binaryMessage: Windows.Devices.Sms.SmsBinaryMessage): Windows.Devices.Sms.SmsTextMessage; - fromBinaryData(format: Windows.Devices.Sms.SmsDataFormat, value: Uint8Array): Windows.Devices.Sms.SmsTextMessage; - } - export class SmsTextMessage implements Windows.Devices.Sms.ISmsTextMessage, Windows.Devices.Sms.ISmsMessage { - body: string; - encoding: Windows.Devices.Sms.SmsEncoding; - from: string; - partCount: number; - partNumber: number; - partReferenceId: number; - timestamp: Date; - to: string; - id: number; - messageClass: Windows.Devices.Sms.SmsMessageClass; - toBinaryMessages(format: Windows.Devices.Sms.SmsDataFormat): Windows.Foundation.Collections.IVectorView; - static fromBinaryMessage(binaryMessage: Windows.Devices.Sms.SmsBinaryMessage): Windows.Devices.Sms.SmsTextMessage; - static fromBinaryData(format: Windows.Devices.Sms.SmsDataFormat, value: Uint8Array): Windows.Devices.Sms.SmsTextMessage; - } - export enum SmsMessageFilter { - all, - unread, - read, - sent, - draft, - } - export enum SmsMessageType { - binary, - text, - } - export class DeleteSmsMessageOperation implements Windows.Foundation.IAsyncAction, Windows.Foundation.IAsyncInfo { - completed: Windows.Foundation.AsyncActionCompletedHandler; - errorCode: number; - id: number; - status: Windows.Foundation.AsyncStatus; - getResults(): void; - cancel(): void; - close(): void; - then(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: any) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: any) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; - operation: { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - getResults(): any; - } - } - export class DeleteSmsMessagesOperation implements Windows.Foundation.IAsyncAction, Windows.Foundation.IAsyncInfo { - completed: Windows.Foundation.AsyncActionCompletedHandler; - errorCode: number; - id: number; - status: Windows.Foundation.AsyncStatus; - getResults(): void; - cancel(): void; - close(): void; - then(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: any) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: any) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; - operation: { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - getResults(): any; - } - } - export class GetSmsMessageOperation implements Windows.Foundation.IAsyncOperation, Windows.Foundation.IAsyncInfo { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - errorCode: number; - id: number; - status: Windows.Foundation.AsyncStatus; - getResults(): Windows.Devices.Sms.ISmsMessage; - cancel(): void; - close(): void; - then(success?: (value: Windows.Devices.Sms.ISmsMessage) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Devices.Sms.ISmsMessage) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Devices.Sms.ISmsMessage) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Devices.Sms.ISmsMessage) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: Windows.Devices.Sms.ISmsMessage) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; - operation: { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - getResults(): Windows.Devices.Sms.ISmsMessage; - } - } - export class GetSmsMessagesOperation implements Windows.Foundation.IAsyncOperationWithProgress, number>, Windows.Foundation.IAsyncInfo { - completed: Windows.Foundation.AsyncOperationWithProgressCompletedHandler, number>; - progress: Windows.Foundation.AsyncOperationProgressHandler, number>; - errorCode: number; - id: number; - status: Windows.Foundation.AsyncStatus; - getResults(): Windows.Foundation.Collections.IVectorView; - cancel(): void; - close(): void; - then(success?: (value: Windows.Foundation.Collections.IVectorView) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Foundation.Collections.IVectorView) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Foundation.Collections.IVectorView) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Foundation.Collections.IVectorView) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: Windows.Foundation.Collections.IVectorView) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; - operation: { - progress: Windows.Foundation.AsyncOperationProgressHandler, number>; - completed: Windows.Foundation.AsyncOperationWithProgressCompletedHandler, number>; - getResults(): Windows.Foundation.Collections.IVectorView; - } - } - export interface ISmsDeviceMessageStore { - maxMessages: number; - deleteMessageAsync(messageId: number): Windows.Foundation.IAsyncAction; - deleteMessagesAsync(messageFilter: Windows.Devices.Sms.SmsMessageFilter): Windows.Foundation.IAsyncAction; - getMessageAsync(messageId: number): Windows.Foundation.IAsyncOperation; - getMessagesAsync(messageFilter: Windows.Devices.Sms.SmsMessageFilter): Windows.Foundation.IAsyncOperationWithProgress, number>; - } - export class SmsDeviceMessageStore implements Windows.Devices.Sms.ISmsDeviceMessageStore { - maxMessages: number; - deleteMessageAsync(messageId: number): Windows.Foundation.IAsyncAction; - deleteMessagesAsync(messageFilter: Windows.Devices.Sms.SmsMessageFilter): Windows.Foundation.IAsyncAction; - getMessageAsync(messageId: number): Windows.Foundation.IAsyncOperation; - getMessagesAsync(messageFilter: Windows.Devices.Sms.SmsMessageFilter): Windows.Foundation.IAsyncOperationWithProgress, number>; - } - export interface SmsEncodedLength { - segmentCount: number; - characterCountLastSegment: number; - charactersPerSegment: number; - byteCountLastSegment: number; - bytesPerSegment: number; - } - export enum CellularClass { - none, - gsm, - cdma, - } - export enum SmsDeviceStatus { - off, - ready, - simNotInserted, - badSim, - deviceFailure, - subscriptionNotActivated, - deviceLocked, - deviceBlocked, - } - export class SendSmsMessageOperation implements Windows.Foundation.IAsyncAction, Windows.Foundation.IAsyncInfo { - completed: Windows.Foundation.AsyncActionCompletedHandler; - errorCode: number; - id: number; - status: Windows.Foundation.AsyncStatus; - getResults(): void; - cancel(): void; - close(): void; - then(success: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success: (value: any) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success: (value: any) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; - operation: { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - getResults(): any; - } - } - export interface ISmsMessageReceivedEventArgs { - binaryMessage: Windows.Devices.Sms.SmsBinaryMessage; - textMessage: Windows.Devices.Sms.SmsTextMessage; - } - export class SmsMessageReceivedEventArgs implements Windows.Devices.Sms.ISmsMessageReceivedEventArgs { - binaryMessage: Windows.Devices.Sms.SmsBinaryMessage; - textMessage: Windows.Devices.Sms.SmsTextMessage; - } - export interface SmsMessageReceivedEventHandler { - (sender: Windows.Devices.Sms.SmsDevice, e: Windows.Devices.Sms.SmsMessageReceivedEventArgs): void; - } - export class SmsDevice implements Windows.Devices.Sms.ISmsDevice { - accountPhoneNumber: string; - cellularClass: Windows.Devices.Sms.CellularClass; - deviceStatus: Windows.Devices.Sms.SmsDeviceStatus; - messageStore: Windows.Devices.Sms.SmsDeviceMessageStore; - sendMessageAsync(message: Windows.Devices.Sms.ISmsMessage): Windows.Devices.Sms.SendSmsMessageOperation; - calculateLength(message: Windows.Devices.Sms.SmsTextMessage): Windows.Devices.Sms.SmsEncodedLength; - onsmsmessagereceived: any/* TODO */; - onsmsdevicestatuschanged: any/* TODO */; - static getDeviceSelector(): string; - static fromIdAsync(deviceInstanceId: string): Windows.Foundation.IAsyncOperation; - static getDefaultAsync(): Windows.Foundation.IAsyncOperation; - } - export interface SmsDeviceStatusChangedEventHandler { - (sender: Windows.Devices.Sms.SmsDevice): void; - } - export class GetSmsDeviceOperation implements Windows.Foundation.IAsyncOperation, Windows.Foundation.IAsyncInfo { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - errorCode: number; - id: number; - status: Windows.Foundation.AsyncStatus; - getResults(): Windows.Devices.Sms.SmsDevice; - cancel(): void; - close(): void; - then(success?: (value: Windows.Devices.Sms.SmsDevice) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Devices.Sms.SmsDevice) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Devices.Sms.SmsDevice) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Devices.Sms.SmsDevice) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: Windows.Devices.Sms.SmsDevice) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; - operation: { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - getResults(): Windows.Devices.Sms.SmsDevice; - } - } - export interface ISmsDeviceStatics { - getDeviceSelector(): string; - fromIdAsync(deviceInstanceId: string): Windows.Foundation.IAsyncOperation; - getDefaultAsync(): Windows.Foundation.IAsyncOperation; - } - export interface ISmsDevice { - accountPhoneNumber: string; - cellularClass: Windows.Devices.Sms.CellularClass; - deviceStatus: Windows.Devices.Sms.SmsDeviceStatus; - messageStore: Windows.Devices.Sms.SmsDeviceMessageStore; - sendMessageAsync(message: Windows.Devices.Sms.ISmsMessage): Windows.Devices.Sms.SendSmsMessageOperation; - calculateLength(message: Windows.Devices.Sms.SmsTextMessage): Windows.Devices.Sms.SmsEncodedLength; - onsmsmessagereceived: any/* TODO */; - onsmsdevicestatuschanged: any/* TODO */; - } - export interface ISmsReceivedEventDetails { - deviceId: string; - messageIndex: number; - } - export class SmsReceivedEventDetails implements Windows.Devices.Sms.ISmsReceivedEventDetails { - deviceId: string; - messageIndex: number; - } - } - } -} -declare module Windows { - export module Devices { - export module Enumeration { - export enum DeviceClass { - all, - audioCapture, - audioRender, - portableStorageDevice, - videoCapture, - } - export enum DeviceWatcherStatus { - created, - started, - enumerationCompleted, - stopping, - stopped, - aborted, - } - export class DeviceThumbnail implements Windows.Storage.Streams.IRandomAccessStreamWithContentType, Windows.Storage.Streams.IRandomAccessStream, Windows.Foundation.IClosable, Windows.Storage.Streams.IInputStream, Windows.Storage.Streams.IOutputStream, Windows.Storage.Streams.IContentTypeProvider { - canRead: boolean; - canWrite: boolean; - position: number; - size: number; - contentType: string; - getInputStreamAt(position: number): Windows.Storage.Streams.IInputStream; - getOutputStreamAt(position: number): Windows.Storage.Streams.IOutputStream; - seek(position: number): void; - cloneStream(): Windows.Storage.Streams.IRandomAccessStream; - dispose(): void; - readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IAsyncOperationWithProgress; - writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperationWithProgress; - flushAsync(): Windows.Foundation.IAsyncOperation; - close(): void; - } - export enum Panel { - unknown, - front, - back, - top, - bottom, - left, - right, - } - export interface IEnclosureLocation { - inDock: boolean; - inLid: boolean; - panel: Windows.Devices.Enumeration.Panel; - } - export class EnclosureLocation implements Windows.Devices.Enumeration.IEnclosureLocation { - inDock: boolean; - inLid: boolean; - panel: Windows.Devices.Enumeration.Panel; - } - export interface IDeviceInformationUpdate { - id: string; - properties: Windows.Foundation.Collections.IMapView; - } - export class DeviceInformationUpdate implements Windows.Devices.Enumeration.IDeviceInformationUpdate { - id: string; - properties: Windows.Foundation.Collections.IMapView; - } - export class DeviceInformationCollection implements Windows.Foundation.Collections.IVectorView, Windows.Foundation.Collections.IIterable { - size: number; - getAt(index: number): Windows.Devices.Enumeration.DeviceInformation; - indexOf(value: Windows.Devices.Enumeration.DeviceInformation): { index: number; returnValue: boolean; }; - getMany(startIndex: number): { items: Windows.Devices.Enumeration.DeviceInformation[]; returnValue: number; }; - first(): Windows.Foundation.Collections.IIterator; - toString(): string; - toLocaleString(): string; - concat(...items: Windows.Devices.Enumeration.DeviceInformation[][]): Windows.Devices.Enumeration.DeviceInformation[]; - join(seperator: string): string; - pop(): Windows.Devices.Enumeration.DeviceInformation; - push(...items: Windows.Devices.Enumeration.DeviceInformation[]): void; - reverse(): Windows.Devices.Enumeration.DeviceInformation[]; - shift(): Windows.Devices.Enumeration.DeviceInformation; - slice(start: number): Windows.Devices.Enumeration.DeviceInformation[]; - slice(start: number, end: number): Windows.Devices.Enumeration.DeviceInformation[]; - sort(): Windows.Devices.Enumeration.DeviceInformation[]; - sort(compareFn: (a: Windows.Devices.Enumeration.DeviceInformation, b: Windows.Devices.Enumeration.DeviceInformation) => number): Windows.Devices.Enumeration.DeviceInformation[]; - splice(start: number): Windows.Devices.Enumeration.DeviceInformation[]; - splice(start: number, deleteCount: number, ...items: Windows.Devices.Enumeration.DeviceInformation[]): Windows.Devices.Enumeration.DeviceInformation[]; - unshift(...items: Windows.Devices.Enumeration.DeviceInformation[]): number; - lastIndexOf(searchElement: Windows.Devices.Enumeration.DeviceInformation): number; - lastIndexOf(searchElement: Windows.Devices.Enumeration.DeviceInformation, fromIndex: number): number; - every(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => boolean): boolean; - every(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => boolean): boolean; - some(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => void ): void; - forEach(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => void , thisArg: any): void; - map(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => any): any[]; - map(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => boolean): Windows.Devices.Enumeration.DeviceInformation[]; - filter(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => boolean, thisArg: any): Windows.Devices.Enumeration.DeviceInformation[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => any, initialValue: any): any; - length: number; - } - export interface IDeviceWatcher { - status: Windows.Devices.Enumeration.DeviceWatcherStatus; - onadded: any/* TODO */; - onupdated: any/* TODO */; - onremoved: any/* TODO */; - onenumerationcompleted: any/* TODO */; - onstopped: any/* TODO */; - start(): void; - stop(): void; - } - export class DeviceWatcher implements Windows.Devices.Enumeration.IDeviceWatcher { - status: Windows.Devices.Enumeration.DeviceWatcherStatus; - onadded: any/* TODO */; - onupdated: any/* TODO */; - onremoved: any/* TODO */; - onenumerationcompleted: any/* TODO */; - onstopped: any/* TODO */; - start(): void; - stop(): void; - } - export class DeviceInformation implements Windows.Devices.Enumeration.IDeviceInformation { - enclosureLocation: Windows.Devices.Enumeration.EnclosureLocation; - id: string; - isDefault: boolean; - isEnabled: boolean; - name: string; - properties: Windows.Foundation.Collections.IMapView; - update(updateInfo: Windows.Devices.Enumeration.DeviceInformationUpdate): void; - getThumbnailAsync(): Windows.Foundation.IAsyncOperation; - getGlyphThumbnailAsync(): Windows.Foundation.IAsyncOperation; - static createFromIdAsync(id: string): Windows.Foundation.IAsyncOperation; - static createFromIdAsync(id: string, additionalProperties: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation; - static findAllAsync(): Windows.Foundation.IAsyncOperation; - static findAllAsync(deviceClass: Windows.Devices.Enumeration.DeviceClass): Windows.Foundation.IAsyncOperation; - static findAllAsync(aqsFilter: string): Windows.Foundation.IAsyncOperation; - static findAllAsync(aqsFilter: string, additionalProperties: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation; - static createWatcher(): Windows.Devices.Enumeration.DeviceWatcher; - static createWatcher(deviceClass: Windows.Devices.Enumeration.DeviceClass): Windows.Devices.Enumeration.DeviceWatcher; - static createWatcher(aqsFilter: string): Windows.Devices.Enumeration.DeviceWatcher; - static createWatcher(aqsFilter: string, additionalProperties: Windows.Foundation.Collections.IIterable): Windows.Devices.Enumeration.DeviceWatcher; - } - export interface IDeviceInformationStatics { - createFromIdAsync(id: string): Windows.Foundation.IAsyncOperation; - createFromIdAsync(id: string, additionalProperties: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation; - findAllAsync(): Windows.Foundation.IAsyncOperation; - findAllAsync(deviceClass: Windows.Devices.Enumeration.DeviceClass): Windows.Foundation.IAsyncOperation; - findAllAsync(aqsFilter: string): Windows.Foundation.IAsyncOperation; - findAllAsync(aqsFilter: string, additionalProperties: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation; - createWatcher(): Windows.Devices.Enumeration.DeviceWatcher; - createWatcher(deviceClass: Windows.Devices.Enumeration.DeviceClass): Windows.Devices.Enumeration.DeviceWatcher; - createWatcher(aqsFilter: string): Windows.Devices.Enumeration.DeviceWatcher; - createWatcher(aqsFilter: string, additionalProperties: Windows.Foundation.Collections.IIterable): Windows.Devices.Enumeration.DeviceWatcher; - } - export interface IDeviceInformation { - enclosureLocation: Windows.Devices.Enumeration.EnclosureLocation; - id: string; - isDefault: boolean; - isEnabled: boolean; - name: string; - properties: Windows.Foundation.Collections.IMapView; - update(updateInfo: Windows.Devices.Enumeration.DeviceInformationUpdate): void; - getThumbnailAsync(): Windows.Foundation.IAsyncOperation; - getGlyphThumbnailAsync(): Windows.Foundation.IAsyncOperation; - } - } - } -} -declare module Windows { - export module Devices { - export module Enumeration { - export module Pnp { - export enum PnpObjectType { - unknown, - deviceInterface, - deviceContainer, - device, - deviceInterfaceClass, - } - export interface IPnpObjectUpdate { - id: string; - properties: Windows.Foundation.Collections.IMapView; - type: Windows.Devices.Enumeration.Pnp.PnpObjectType; - } - export class PnpObjectUpdate implements Windows.Devices.Enumeration.Pnp.IPnpObjectUpdate { - id: string; - properties: Windows.Foundation.Collections.IMapView; - type: Windows.Devices.Enumeration.Pnp.PnpObjectType; - } - export class PnpObjectCollection implements Windows.Foundation.Collections.IVectorView, Windows.Foundation.Collections.IIterable { - size: number; - getAt(index: number): Windows.Devices.Enumeration.Pnp.PnpObject; - indexOf(value: Windows.Devices.Enumeration.Pnp.PnpObject): { index: number; returnValue: boolean; }; - getMany(startIndex: number): { items: Windows.Devices.Enumeration.Pnp.PnpObject[]; returnValue: number; }; - first(): Windows.Foundation.Collections.IIterator; - toString(): string; - toLocaleString(): string; - concat(...items: Windows.Devices.Enumeration.Pnp.PnpObject[][]): Windows.Devices.Enumeration.Pnp.PnpObject[]; - join(seperator: string): string; - pop(): Windows.Devices.Enumeration.Pnp.PnpObject; - push(...items: Windows.Devices.Enumeration.Pnp.PnpObject[]): void; - reverse(): Windows.Devices.Enumeration.Pnp.PnpObject[]; - shift(): Windows.Devices.Enumeration.Pnp.PnpObject; - slice(start: number): Windows.Devices.Enumeration.Pnp.PnpObject[]; - slice(start: number, end: number): Windows.Devices.Enumeration.Pnp.PnpObject[]; - sort(): Windows.Devices.Enumeration.Pnp.PnpObject[]; - sort(compareFn: (a: Windows.Devices.Enumeration.Pnp.PnpObject, b: Windows.Devices.Enumeration.Pnp.PnpObject) => number): Windows.Devices.Enumeration.Pnp.PnpObject[]; - splice(start: number): Windows.Devices.Enumeration.Pnp.PnpObject[]; - splice(start: number, deleteCount: number, ...items: Windows.Devices.Enumeration.Pnp.PnpObject[]): Windows.Devices.Enumeration.Pnp.PnpObject[]; - unshift(...items: Windows.Devices.Enumeration.Pnp.PnpObject[]): number; - lastIndexOf(searchElement: Windows.Devices.Enumeration.Pnp.PnpObject): number; - lastIndexOf(searchElement: Windows.Devices.Enumeration.Pnp.PnpObject, fromIndex: number): number; - every(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => boolean): boolean; - every(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => boolean): boolean; - some(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => void ): void; - forEach(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => void , thisArg: any): void; - map(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => any): any[]; - map(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => boolean): Windows.Devices.Enumeration.Pnp.PnpObject[]; - filter(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => boolean, thisArg: any): Windows.Devices.Enumeration.Pnp.PnpObject[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => any, initialValue: any): any; - length: number; - } - export interface IPnpObjectWatcher { - status: Windows.Devices.Enumeration.DeviceWatcherStatus; - onadded: any/* TODO */; - onupdated: any/* TODO */; - onremoved: any/* TODO */; - onenumerationcompleted: any/* TODO */; - onstopped: any/* TODO */; - start(): void; - stop(): void; - } - export class PnpObjectWatcher implements Windows.Devices.Enumeration.Pnp.IPnpObjectWatcher { - status: Windows.Devices.Enumeration.DeviceWatcherStatus; - onadded: any/* TODO */; - onupdated: any/* TODO */; - onremoved: any/* TODO */; - onenumerationcompleted: any/* TODO */; - onstopped: any/* TODO */; - start(): void; - stop(): void; - } - export class PnpObject implements Windows.Devices.Enumeration.Pnp.IPnpObject { - id: string; - properties: Windows.Foundation.Collections.IMapView; - type: Windows.Devices.Enumeration.Pnp.PnpObjectType; - update(updateInfo: Windows.Devices.Enumeration.Pnp.PnpObjectUpdate): void; - static createFromIdAsync(type: Windows.Devices.Enumeration.Pnp.PnpObjectType, id: string, requestedProperties: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation; - static findAllAsync(type: Windows.Devices.Enumeration.Pnp.PnpObjectType, requestedProperties: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation; - static findAllAsync(type: Windows.Devices.Enumeration.Pnp.PnpObjectType, requestedProperties: Windows.Foundation.Collections.IIterable, aqsFilter: string): Windows.Foundation.IAsyncOperation; - static createWatcher(type: Windows.Devices.Enumeration.Pnp.PnpObjectType, requestedProperties: Windows.Foundation.Collections.IIterable): Windows.Devices.Enumeration.Pnp.PnpObjectWatcher; - static createWatcher(type: Windows.Devices.Enumeration.Pnp.PnpObjectType, requestedProperties: Windows.Foundation.Collections.IIterable, aqsFilter: string): Windows.Devices.Enumeration.Pnp.PnpObjectWatcher; - } - export interface IPnpObjectStatics { - createFromIdAsync(type: Windows.Devices.Enumeration.Pnp.PnpObjectType, id: string, requestedProperties: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation; - findAllAsync(type: Windows.Devices.Enumeration.Pnp.PnpObjectType, requestedProperties: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation; - findAllAsync(type: Windows.Devices.Enumeration.Pnp.PnpObjectType, requestedProperties: Windows.Foundation.Collections.IIterable, aqsFilter: string): Windows.Foundation.IAsyncOperation; - createWatcher(type: Windows.Devices.Enumeration.Pnp.PnpObjectType, requestedProperties: Windows.Foundation.Collections.IIterable): Windows.Devices.Enumeration.Pnp.PnpObjectWatcher; - createWatcher(type: Windows.Devices.Enumeration.Pnp.PnpObjectType, requestedProperties: Windows.Foundation.Collections.IIterable, aqsFilter: string): Windows.Devices.Enumeration.Pnp.PnpObjectWatcher; - } - export interface IPnpObject { - id: string; - properties: Windows.Foundation.Collections.IMapView; - type: Windows.Devices.Enumeration.Pnp.PnpObjectType; - update(updateInfo: Windows.Devices.Enumeration.Pnp.PnpObjectUpdate): void; - } - } - } - } -} -declare module Windows { - export module Devices { - export module Geolocation { - export enum PositionAccuracy { - default, - high, - } - export enum PositionStatus { - ready, - initializing, - noData, - disabled, - notInitialized, - notAvailable, - } - export interface IGeocoordinate { - accuracy: number; - altitude: number; - altitudeAccuracy: number; - heading: number; - latitude: number; - longitude: number; - speed: number; - timestamp: Date; - } - export class Geocoordinate implements Windows.Devices.Geolocation.IGeocoordinate { - accuracy: number; - altitude: number; - altitudeAccuracy: number; - heading: number; - latitude: number; - longitude: number; - speed: number; - timestamp: Date; - } - export interface ICivicAddress { - city: string; - country: string; - postalCode: string; - state: string; - timestamp: Date; - } - export class CivicAddress implements Windows.Devices.Geolocation.ICivicAddress { - city: string; - country: string; - postalCode: string; - state: string; - timestamp: Date; - } - export interface IGeoposition { - civicAddress: Windows.Devices.Geolocation.CivicAddress; - coordinate: Windows.Devices.Geolocation.Geocoordinate; - } - export class Geoposition implements Windows.Devices.Geolocation.IGeoposition { - civicAddress: Windows.Devices.Geolocation.CivicAddress; - coordinate: Windows.Devices.Geolocation.Geocoordinate; - } - export interface IPositionChangedEventArgs { - position: Windows.Devices.Geolocation.Geoposition; - } - export class PositionChangedEventArgs implements Windows.Devices.Geolocation.IPositionChangedEventArgs { - position: Windows.Devices.Geolocation.Geoposition; - } - export interface IStatusChangedEventArgs { - status: Windows.Devices.Geolocation.PositionStatus; - } - export class StatusChangedEventArgs implements Windows.Devices.Geolocation.IStatusChangedEventArgs { - status: Windows.Devices.Geolocation.PositionStatus; - } - export interface IGeolocator { - desiredAccuracy: Windows.Devices.Geolocation.PositionAccuracy; - locationStatus: Windows.Devices.Geolocation.PositionStatus; - movementThreshold: number; - reportInterval: number; - getGeopositionAsync(): Windows.Foundation.IAsyncOperation; - getGeopositionAsync(maximumAge: number, timeout: number): Windows.Foundation.IAsyncOperation; - onpositionchanged: any/* TODO */; - onstatuschanged: any/* TODO */; - } - export class Geolocator implements Windows.Devices.Geolocation.IGeolocator { - desiredAccuracy: Windows.Devices.Geolocation.PositionAccuracy; - locationStatus: Windows.Devices.Geolocation.PositionStatus; - movementThreshold: number; - reportInterval: number; - getGeopositionAsync(): Windows.Foundation.IAsyncOperation; - getGeopositionAsync(maximumAge: number, timeout: number): Windows.Foundation.IAsyncOperation; - onpositionchanged: any/* TODO */; - onstatuschanged: any/* TODO */; - } - } - } -} -declare module Windows { - export module Devices { - export module Input { - export enum PointerDeviceType { - touch, - pen, - mouse, - } - export interface PointerDeviceUsage { - usagePage: number; - usage: number; - minLogical: number; - maxLogical: number; - minPhysical: number; - maxPhysical: number; - unit: number; - physicalMultiplier: number; - } - export interface MouseDelta { - x: number; - y: number; - } - export interface IMouseCapabilities { - horizontalWheelPresent: number; - mousePresent: number; - numberOfButtons: number; - swapButtons: number; - verticalWheelPresent: number; - } - export interface IKeyboardCapabilities { - keyboardPresent: number; - } - export interface ITouchCapabilities { - contacts: number; - touchPresent: number; - } - export interface IPointerDeviceStatics { - getPointerDevice(pointerId: number): Windows.Devices.Input.PointerDevice; - getPointerDevices(): Windows.Foundation.Collections.IVectorView; - } - export class PointerDevice implements Windows.Devices.Input.IPointerDevice { - isIntegrated: boolean; - maxContacts: number; - physicalDeviceRect: Windows.Foundation.Rect; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - screenRect: Windows.Foundation.Rect; - supportedUsages: Windows.Foundation.Collections.IVectorView; - static getPointerDevice(pointerId: number): Windows.Devices.Input.PointerDevice; - static getPointerDevices(): Windows.Foundation.Collections.IVectorView; - } - export interface IPointerDevice { - isIntegrated: boolean; - maxContacts: number; - physicalDeviceRect: Windows.Foundation.Rect; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - screenRect: Windows.Foundation.Rect; - supportedUsages: Windows.Foundation.Collections.IVectorView; - } - export interface IMouseEventArgs { - mouseDelta: Windows.Devices.Input.MouseDelta; - } - export interface IMouseDevice { - onmousemoved: any/* TODO */; - } - export class MouseDevice implements Windows.Devices.Input.IMouseDevice { - onmousemoved: any/* TODO */; - static getForCurrentView(): Windows.Devices.Input.MouseDevice; - } - export class MouseEventArgs implements Windows.Devices.Input.IMouseEventArgs { - mouseDelta: Windows.Devices.Input.MouseDelta; - } - export interface IMouseDeviceStatics { - getForCurrentView(): Windows.Devices.Input.MouseDevice; - } - export class MouseCapabilities implements Windows.Devices.Input.IMouseCapabilities { - horizontalWheelPresent: number; - mousePresent: number; - numberOfButtons: number; - swapButtons: number; - verticalWheelPresent: number; - } - export class KeyboardCapabilities implements Windows.Devices.Input.IKeyboardCapabilities { - keyboardPresent: number; - } - export class TouchCapabilities implements Windows.Devices.Input.ITouchCapabilities { - contacts: number; - touchPresent: number; - } - } - } -} -declare module Windows { - export module Devices { - export module Portable { - export enum ServiceDeviceType { - calendarService, - contactsService, - deviceStatusService, - notesService, - ringtonesService, - smsService, - tasksService, - } - export interface IStorageDeviceStatics { - fromId(interfaceId: string): Windows.Storage.StorageFolder; - getDeviceSelector(): string; - } - export interface IServiceDeviceStatics { - getDeviceSelector(serviceType: Windows.Devices.Portable.ServiceDeviceType): string; - getDeviceSelectorFromServiceId(serviceId: string): string; - } - export class StorageDevice { - static fromId(interfaceId: string): Windows.Storage.StorageFolder; - static getDeviceSelector(): string; - } - export class ServiceDevice { - static getDeviceSelector(serviceType: Windows.Devices.Portable.ServiceDeviceType): string; - static getDeviceSelectorFromServiceId(serviceId: string): string; - } - } - } -} -declare module Windows { - export module Devices { - export module Printers { - export module Extensions { - export interface IPrintTaskConfigurationSaveRequestedDeferral { - complete(): void; - } - export class PrintTaskConfigurationSaveRequestedDeferral implements Windows.Devices.Printers.Extensions.IPrintTaskConfigurationSaveRequestedDeferral { - complete(): void; - } - export interface IPrintTaskConfigurationSaveRequest { - deadline: Date; - cancel(): void; - save(printerExtensionContext: any): void; - getDeferral(): Windows.Devices.Printers.Extensions.PrintTaskConfigurationSaveRequestedDeferral; - } - export class PrintTaskConfigurationSaveRequest implements Windows.Devices.Printers.Extensions.IPrintTaskConfigurationSaveRequest { - deadline: Date; - cancel(): void; - save(printerExtensionContext: any): void; - getDeferral(): Windows.Devices.Printers.Extensions.PrintTaskConfigurationSaveRequestedDeferral; - } - export interface IPrintTaskConfigurationSaveRequestedEventArgs { - request: Windows.Devices.Printers.Extensions.PrintTaskConfigurationSaveRequest; - } - export class PrintTaskConfigurationSaveRequestedEventArgs implements Windows.Devices.Printers.Extensions.IPrintTaskConfigurationSaveRequestedEventArgs { - request: Windows.Devices.Printers.Extensions.PrintTaskConfigurationSaveRequest; - } - export interface IPrintTaskConfiguration { - printerExtensionContext: any; - onsaverequested: any/* TODO */; - } - export class PrintTaskConfiguration implements Windows.Devices.Printers.Extensions.IPrintTaskConfiguration { - printerExtensionContext: any; - onsaverequested: any/* TODO */; - } - export interface IPrintNotificationEventDetails { - eventData: string; - printerName: string; - } - export class PrintNotificationEventDetails implements Windows.Devices.Printers.Extensions.IPrintNotificationEventDetails { - eventData: string; - printerName: string; - } - export interface IPrintExtensionContextStatic { - fromDeviceId(deviceId: string): any; - } - export class PrintExtensionContext { - static fromDeviceId(deviceId: string): any; - } - } - } - } -} -declare module Windows { - export module Devices { - export module Sensors { - export interface IAccelerometerStatics { - getDefault(): Windows.Devices.Sensors.Accelerometer; - } - export class Accelerometer implements Windows.Devices.Sensors.IAccelerometer { - minimumReportInterval: number; - reportInterval: number; - getCurrentReading(): Windows.Devices.Sensors.AccelerometerReading; - onreadingchanged: any/* TODO */; - onshaken: any/* TODO */; - static getDefault(): Windows.Devices.Sensors.Accelerometer; - } - export interface IAccelerometer { - minimumReportInterval: number; - reportInterval: number; - getCurrentReading(): Windows.Devices.Sensors.AccelerometerReading; - onreadingchanged: any/* TODO */; - onshaken: any/* TODO */; - } - export class AccelerometerReading implements Windows.Devices.Sensors.IAccelerometerReading { - accelerationX: number; - accelerationY: number; - accelerationZ: number; - timestamp: Date; - } - export class AccelerometerReadingChangedEventArgs implements Windows.Devices.Sensors.IAccelerometerReadingChangedEventArgs { - reading: Windows.Devices.Sensors.AccelerometerReading; - } - export class AccelerometerShakenEventArgs implements Windows.Devices.Sensors.IAccelerometerShakenEventArgs { - timestamp: Date; - } - export interface IAccelerometerReading { - accelerationX: number; - accelerationY: number; - accelerationZ: number; - timestamp: Date; - } - export interface IAccelerometerReadingChangedEventArgs { - reading: Windows.Devices.Sensors.AccelerometerReading; - } - export interface IAccelerometerShakenEventArgs { - timestamp: Date; - } - export interface IInclinometerStatics { - getDefault(): Windows.Devices.Sensors.Inclinometer; - } - export class Inclinometer implements Windows.Devices.Sensors.IInclinometer { - minimumReportInterval: number; - reportInterval: number; - getCurrentReading(): Windows.Devices.Sensors.InclinometerReading; - onreadingchanged: any/* TODO */; - static getDefault(): Windows.Devices.Sensors.Inclinometer; - } - export interface IInclinometer { - minimumReportInterval: number; - reportInterval: number; - getCurrentReading(): Windows.Devices.Sensors.InclinometerReading; - onreadingchanged: any/* TODO */; - } - export class InclinometerReading implements Windows.Devices.Sensors.IInclinometerReading { - pitchDegrees: number; - rollDegrees: number; - timestamp: Date; - yawDegrees: number; - } - export class InclinometerReadingChangedEventArgs implements Windows.Devices.Sensors.IInclinometerReadingChangedEventArgs { - reading: Windows.Devices.Sensors.InclinometerReading; - } - export interface IInclinometerReading { - pitchDegrees: number; - rollDegrees: number; - timestamp: Date; - yawDegrees: number; - } - export interface IInclinometerReadingChangedEventArgs { - reading: Windows.Devices.Sensors.InclinometerReading; - } - export interface IGyrometerStatics { - getDefault(): Windows.Devices.Sensors.Gyrometer; - } - export class Gyrometer implements Windows.Devices.Sensors.IGyrometer { - minimumReportInterval: number; - reportInterval: number; - getCurrentReading(): Windows.Devices.Sensors.GyrometerReading; - onreadingchanged: any/* TODO */; - static getDefault(): Windows.Devices.Sensors.Gyrometer; - } - export interface IGyrometer { - minimumReportInterval: number; - reportInterval: number; - getCurrentReading(): Windows.Devices.Sensors.GyrometerReading; - onreadingchanged: any/* TODO */; - } - export class GyrometerReading implements Windows.Devices.Sensors.IGyrometerReading { - angularVelocityX: number; - angularVelocityY: number; - angularVelocityZ: number; - timestamp: Date; - } - export class GyrometerReadingChangedEventArgs implements Windows.Devices.Sensors.IGyrometerReadingChangedEventArgs { - reading: Windows.Devices.Sensors.GyrometerReading; - } - export interface IGyrometerReading { - angularVelocityX: number; - angularVelocityY: number; - angularVelocityZ: number; - timestamp: Date; - } - export interface IGyrometerReadingChangedEventArgs { - reading: Windows.Devices.Sensors.GyrometerReading; - } - export interface ICompassStatics { - getDefault(): Windows.Devices.Sensors.Compass; - } - export class Compass implements Windows.Devices.Sensors.ICompass { - minimumReportInterval: number; - reportInterval: number; - getCurrentReading(): Windows.Devices.Sensors.CompassReading; - onreadingchanged: any/* TODO */; - static getDefault(): Windows.Devices.Sensors.Compass; - } - export interface ICompass { - minimumReportInterval: number; - reportInterval: number; - getCurrentReading(): Windows.Devices.Sensors.CompassReading; - onreadingchanged: any/* TODO */; - } - export class CompassReading implements Windows.Devices.Sensors.ICompassReading { - headingMagneticNorth: number; - headingTrueNorth: number; - timestamp: Date; - } - export class CompassReadingChangedEventArgs implements Windows.Devices.Sensors.ICompassReadingChangedEventArgs { - reading: Windows.Devices.Sensors.CompassReading; - } - export interface ICompassReading { - headingMagneticNorth: number; - headingTrueNorth: number; - timestamp: Date; - } - export interface ICompassReadingChangedEventArgs { - reading: Windows.Devices.Sensors.CompassReading; - } - export interface ILightSensorStatics { - getDefault(): Windows.Devices.Sensors.LightSensor; - } - export class LightSensor implements Windows.Devices.Sensors.ILightSensor { - minimumReportInterval: number; - reportInterval: number; - getCurrentReading(): Windows.Devices.Sensors.LightSensorReading; - onreadingchanged: any/* TODO */; - static getDefault(): Windows.Devices.Sensors.LightSensor; - } - export interface ILightSensor { - minimumReportInterval: number; - reportInterval: number; - getCurrentReading(): Windows.Devices.Sensors.LightSensorReading; - onreadingchanged: any/* TODO */; - } - export class LightSensorReading implements Windows.Devices.Sensors.ILightSensorReading { - illuminanceInLux: number; - timestamp: Date; - } - export class LightSensorReadingChangedEventArgs implements Windows.Devices.Sensors.ILightSensorReadingChangedEventArgs { - reading: Windows.Devices.Sensors.LightSensorReading; - } - export interface ILightSensorReading { - illuminanceInLux: number; - timestamp: Date; - } - export interface ILightSensorReadingChangedEventArgs { - reading: Windows.Devices.Sensors.LightSensorReading; - } - export interface ISensorRotationMatrix { - m11: number; - m12: number; - m13: number; - m21: number; - m22: number; - m23: number; - m31: number; - m32: number; - m33: number; - } - export interface ISensorQuaternion { - w: number; - x: number; - y: number; - z: number; - } - export class SensorRotationMatrix implements Windows.Devices.Sensors.ISensorRotationMatrix { - m11: number; - m12: number; - m13: number; - m21: number; - m22: number; - m23: number; - m31: number; - m32: number; - m33: number; - } - export class SensorQuaternion implements Windows.Devices.Sensors.ISensorQuaternion { - w: number; - x: number; - y: number; - z: number; - } - export interface IOrientationSensorStatics { - getDefault(): Windows.Devices.Sensors.OrientationSensor; - } - export class OrientationSensor implements Windows.Devices.Sensors.IOrientationSensor { - minimumReportInterval: number; - reportInterval: number; - getCurrentReading(): Windows.Devices.Sensors.OrientationSensorReading; - onreadingchanged: any/* TODO */; - static getDefault(): Windows.Devices.Sensors.OrientationSensor; - } - export interface IOrientationSensor { - minimumReportInterval: number; - reportInterval: number; - getCurrentReading(): Windows.Devices.Sensors.OrientationSensorReading; - onreadingchanged: any/* TODO */; - } - export class OrientationSensorReading implements Windows.Devices.Sensors.IOrientationSensorReading { - quaternion: Windows.Devices.Sensors.SensorQuaternion; - rotationMatrix: Windows.Devices.Sensors.SensorRotationMatrix; - timestamp: Date; - } - export class OrientationSensorReadingChangedEventArgs implements Windows.Devices.Sensors.IOrientationSensorReadingChangedEventArgs { - reading: Windows.Devices.Sensors.OrientationSensorReading; - } - export interface IOrientationSensorReading { - quaternion: Windows.Devices.Sensors.SensorQuaternion; - rotationMatrix: Windows.Devices.Sensors.SensorRotationMatrix; - timestamp: Date; - } - export interface IOrientationSensorReadingChangedEventArgs { - reading: Windows.Devices.Sensors.OrientationSensorReading; - } - export enum SimpleOrientation { - notRotated, - rotated90DegreesCounterclockwise, - rotated180DegreesCounterclockwise, - rotated270DegreesCounterclockwise, - faceup, - facedown, - } - export interface ISimpleOrientationSensorStatics { - getDefault(): Windows.Devices.Sensors.SimpleOrientationSensor; - } - export class SimpleOrientationSensor implements Windows.Devices.Sensors.ISimpleOrientationSensor { - getCurrentOrientation(): Windows.Devices.Sensors.SimpleOrientation; - onorientationchanged: any/* TODO */; - static getDefault(): Windows.Devices.Sensors.SimpleOrientationSensor; - } - export interface ISimpleOrientationSensor { - getCurrentOrientation(): Windows.Devices.Sensors.SimpleOrientation; - onorientationchanged: any/* TODO */; - } - export class SimpleOrientationSensorOrientationChangedEventArgs implements Windows.Devices.Sensors.ISimpleOrientationSensorOrientationChangedEventArgs { - orientation: Windows.Devices.Sensors.SimpleOrientation; - timestamp: Date; - } - export interface ISimpleOrientationSensorOrientationChangedEventArgs { - orientation: Windows.Devices.Sensors.SimpleOrientation; - timestamp: Date; - } - } - } -} -declare module Windows { - export module Globalization { - export module Fonts { - export interface ILanguageFontGroup { - documentAlternate1Font: Windows.Globalization.Fonts.LanguageFont; - documentAlternate2Font: Windows.Globalization.Fonts.LanguageFont; - documentHeadingFont: Windows.Globalization.Fonts.LanguageFont; - fixedWidthTextFont: Windows.Globalization.Fonts.LanguageFont; - modernDocumentFont: Windows.Globalization.Fonts.LanguageFont; - traditionalDocumentFont: Windows.Globalization.Fonts.LanguageFont; - uICaptionFont: Windows.Globalization.Fonts.LanguageFont; - uIHeadingFont: Windows.Globalization.Fonts.LanguageFont; - uINotificationHeadingFont: Windows.Globalization.Fonts.LanguageFont; - uITextFont: Windows.Globalization.Fonts.LanguageFont; - uITitleFont: Windows.Globalization.Fonts.LanguageFont; - } - export class LanguageFont implements Windows.Globalization.Fonts.ILanguageFont { - fontFamily: string; - fontStretch: Windows.UI.Text.FontStretch; - fontStyle: Windows.UI.Text.FontStyle; - fontWeight: Windows.UI.Text.FontWeight; - scaleFactor: number; - } - export interface ILanguageFontGroupFactory { - createLanguageFontGroup(languageTag: string): Windows.Globalization.Fonts.LanguageFontGroup; - } - export class LanguageFontGroup implements Windows.Globalization.Fonts.ILanguageFontGroup { - constructor(languageTag: string); - documentAlternate1Font: Windows.Globalization.Fonts.LanguageFont; - documentAlternate2Font: Windows.Globalization.Fonts.LanguageFont; - documentHeadingFont: Windows.Globalization.Fonts.LanguageFont; - fixedWidthTextFont: Windows.Globalization.Fonts.LanguageFont; - modernDocumentFont: Windows.Globalization.Fonts.LanguageFont; - traditionalDocumentFont: Windows.Globalization.Fonts.LanguageFont; - uICaptionFont: Windows.Globalization.Fonts.LanguageFont; - uIHeadingFont: Windows.Globalization.Fonts.LanguageFont; - uINotificationHeadingFont: Windows.Globalization.Fonts.LanguageFont; - uITextFont: Windows.Globalization.Fonts.LanguageFont; - uITitleFont: Windows.Globalization.Fonts.LanguageFont; - } - export interface ILanguageFont { - fontFamily: string; - fontStretch: Windows.UI.Text.FontStretch; - fontStyle: Windows.UI.Text.FontStyle; - fontWeight: Windows.UI.Text.FontWeight; - scaleFactor: number; - } - } - } -} -declare module Windows { - export module Globalization { - export enum DayOfWeek { - sunday, - monday, - tuesday, - wednesday, - thursday, - friday, - saturday, - } - export interface ICalendarIdentifiersStatics { - gregorian: string; - hebrew: string; - hijri: string; - japanese: string; - julian: string; - korean: string; - taiwan: string; - thai: string; - umAlQura: string; - } - export class CalendarIdentifiers { - static gregorian: string; - static hebrew: string; - static hijri: string; - static japanese: string; - static julian: string; - static korean: string; - static taiwan: string; - static thai: string; - static umAlQura: string; - } - export interface IClockIdentifiersStatics { - twelveHour: string; - twentyFourHour: string; - } - export class ClockIdentifiers { - static twelveHour: string; - static twentyFourHour: string; - } - export interface IGeographicRegion { - code: string; - codeThreeDigit: string; - codeThreeLetter: string; - codeTwoLetter: string; - currenciesInUse: Windows.Foundation.Collections.IVectorView; - displayName: string; - nativeName: string; - } - export interface IGeographicRegionFactory { - createGeographicRegion(geographicRegionCode: string): Windows.Globalization.GeographicRegion; - } - export class GeographicRegion implements Windows.Globalization.IGeographicRegion { - constructor(geographicRegionCode: string); - constructor(); - code: string; - codeThreeDigit: string; - codeThreeLetter: string; - codeTwoLetter: string; - currenciesInUse: Windows.Foundation.Collections.IVectorView; - displayName: string; - nativeName: string; - static isSupported(geographicRegionCode: string): boolean; - } - export interface IGeographicRegionStatics { - isSupported(geographicRegionCode: string): boolean; - } - export interface ILanguage { - displayName: string; - languageTag: string; - nativeName: string; - script: string; - } - export interface ILanguageFactory { - createLanguage(languageTag: string): Windows.Globalization.Language; - } - export class Language implements Windows.Globalization.ILanguage { - constructor(languageTag: string); - displayName: string; - languageTag: string; - nativeName: string; - script: string; - static currentInputMethodLanguageTag: string; - static isWellFormed(languageTag: string): boolean; - } - export interface ILanguageStatics { - currentInputMethodLanguageTag: string; - isWellFormed(languageTag: string): boolean; - } - export interface ICalendar { - day: number; - dayOfWeek: Windows.Globalization.DayOfWeek; - era: number; - firstDayInThisMonth: number; - firstEra: number; - firstHourInThisPeriod: number; - firstMinuteInThisHour: number; - firstMonthInThisYear: number; - firstPeriodInThisDay: number; - firstSecondInThisMinute: number; - firstYearInThisEra: number; - hour: number; - isDaylightSavingTime: boolean; - languages: Windows.Foundation.Collections.IVectorView; - lastDayInThisMonth: number; - lastEra: number; - lastHourInThisPeriod: number; - lastMinuteInThisHour: number; - lastMonthInThisYear: number; - lastPeriodInThisDay: number; - lastSecondInThisMinute: number; - lastYearInThisEra: number; - minute: number; - month: number; - nanosecond: number; - numberOfDaysInThisMonth: number; - numberOfEras: number; - numberOfHoursInThisPeriod: number; - numberOfMinutesInThisHour: number; - numberOfMonthsInThisYear: number; - numberOfPeriodsInThisDay: number; - numberOfSecondsInThisMinute: number; - numberOfYearsInThisEra: number; - numeralSystem: string; - period: number; - resolvedLanguage: string; - second: number; - year: number; - clone(): Windows.Globalization.Calendar; - setToMin(): void; - setToMax(): void; - getCalendarSystem(): string; - changeCalendarSystem(value: string): void; - getClock(): string; - changeClock(value: string): void; - getDateTime(): Date; - setDateTime(value: Date): void; - setToNow(): void; - addEras(eras: number): void; - eraAsString(): string; - eraAsString(idealLength: number): string; - addYears(years: number): void; - yearAsString(): string; - yearAsTruncatedString(remainingDigits: number): string; - yearAsPaddedString(minDigits: number): string; - addMonths(months: number): void; - monthAsString(): string; - monthAsString(idealLength: number): string; - monthAsSoloString(): string; - monthAsSoloString(idealLength: number): string; - monthAsNumericString(): string; - monthAsPaddedNumericString(minDigits: number): string; - addWeeks(weeks: number): void; - addDays(days: number): void; - dayAsString(): string; - dayAsPaddedString(minDigits: number): string; - dayOfWeekAsString(): string; - dayOfWeekAsString(idealLength: number): string; - dayOfWeekAsSoloString(): string; - dayOfWeekAsSoloString(idealLength: number): string; - addPeriods(periods: number): void; - periodAsString(): string; - periodAsString(idealLength: number): string; - addHours(hours: number): void; - hourAsString(): string; - hourAsPaddedString(minDigits: number): string; - addMinutes(minutes: number): void; - minuteAsString(): string; - minuteAsPaddedString(minDigits: number): string; - addSeconds(seconds: number): void; - secondAsString(): string; - secondAsPaddedString(minDigits: number): string; - addNanoseconds(nanoseconds: number): void; - nanosecondAsString(): string; - nanosecondAsPaddedString(minDigits: number): string; - compare(other: Windows.Globalization.Calendar): number; - compareDateTime(other: Date): number; - copyTo(other: Windows.Globalization.Calendar): void; - } - export class Calendar implements Windows.Globalization.ICalendar { - constructor(languages: Windows.Foundation.Collections.IIterable); - constructor(languages: Windows.Foundation.Collections.IIterable, calendar: string, clock: string); - constructor(); - day: number; - dayOfWeek: Windows.Globalization.DayOfWeek; - era: number; - firstDayInThisMonth: number; - firstEra: number; - firstHourInThisPeriod: number; - firstMinuteInThisHour: number; - firstMonthInThisYear: number; - firstPeriodInThisDay: number; - firstSecondInThisMinute: number; - firstYearInThisEra: number; - hour: number; - isDaylightSavingTime: boolean; - languages: Windows.Foundation.Collections.IVectorView; - lastDayInThisMonth: number; - lastEra: number; - lastHourInThisPeriod: number; - lastMinuteInThisHour: number; - lastMonthInThisYear: number; - lastPeriodInThisDay: number; - lastSecondInThisMinute: number; - lastYearInThisEra: number; - minute: number; - month: number; - nanosecond: number; - numberOfDaysInThisMonth: number; - numberOfEras: number; - numberOfHoursInThisPeriod: number; - numberOfMinutesInThisHour: number; - numberOfMonthsInThisYear: number; - numberOfPeriodsInThisDay: number; - numberOfSecondsInThisMinute: number; - numberOfYearsInThisEra: number; - numeralSystem: string; - period: number; - resolvedLanguage: string; - second: number; - year: number; - clone(): Windows.Globalization.Calendar; - setToMin(): void; - setToMax(): void; - getCalendarSystem(): string; - changeCalendarSystem(value: string): void; - getClock(): string; - changeClock(value: string): void; - getDateTime(): Date; - setDateTime(value: Date): void; - setToNow(): void; - addEras(eras: number): void; - eraAsString(): string; - eraAsString(idealLength: number): string; - addYears(years: number): void; - yearAsString(): string; - yearAsTruncatedString(remainingDigits: number): string; - yearAsPaddedString(minDigits: number): string; - addMonths(months: number): void; - monthAsString(): string; - monthAsString(idealLength: number): string; - monthAsSoloString(): string; - monthAsSoloString(idealLength: number): string; - monthAsNumericString(): string; - monthAsPaddedNumericString(minDigits: number): string; - addWeeks(weeks: number): void; - addDays(days: number): void; - dayAsString(): string; - dayAsPaddedString(minDigits: number): string; - dayOfWeekAsString(): string; - dayOfWeekAsString(idealLength: number): string; - dayOfWeekAsSoloString(): string; - dayOfWeekAsSoloString(idealLength: number): string; - addPeriods(periods: number): void; - periodAsString(): string; - periodAsString(idealLength: number): string; - addHours(hours: number): void; - hourAsString(): string; - hourAsPaddedString(minDigits: number): string; - addMinutes(minutes: number): void; - minuteAsString(): string; - minuteAsPaddedString(minDigits: number): string; - addSeconds(seconds: number): void; - secondAsString(): string; - secondAsPaddedString(minDigits: number): string; - addNanoseconds(nanoseconds: number): void; - nanosecondAsString(): string; - nanosecondAsPaddedString(minDigits: number): string; - compare(other: Windows.Globalization.Calendar): number; - compareDateTime(other: Date): number; - copyTo(other: Windows.Globalization.Calendar): void; - } - export interface ICalendarFactory { - createCalendarDefaultCalendarAndClock(languages: Windows.Foundation.Collections.IIterable): Windows.Globalization.Calendar; - createCalendar(languages: Windows.Foundation.Collections.IIterable, calendar: string, clock: string): Windows.Globalization.Calendar; - } - export interface IApplicationLanguagesStatics { - languages: Windows.Foundation.Collections.IVectorView; - manifestLanguages: Windows.Foundation.Collections.IVectorView; - primaryLanguageOverride: string; - } - export class ApplicationLanguages { - static languages: Windows.Foundation.Collections.IVectorView; - static manifestLanguages: Windows.Foundation.Collections.IVectorView; - static primaryLanguageOverride: string; - } - } -} -declare module Windows { - export module Globalization { - export module DateTimeFormatting { - export enum YearFormat { - none, - default, - abbreviated, - full, - } - export enum MonthFormat { - none, - default, - abbreviated, - full, - numeric, - } - export enum DayOfWeekFormat { - none, - default, - abbreviated, - full, - } - export enum DayFormat { - none, - default, - } - export enum HourFormat { - none, - default, - } - export enum MinuteFormat { - none, - default, - } - export enum SecondFormat { - none, - default, - } - export interface IDateTimeFormatter { - calendar: string; - clock: string; - geographicRegion: string; - includeDay: Windows.Globalization.DateTimeFormatting.DayFormat; - includeDayOfWeek: Windows.Globalization.DateTimeFormatting.DayOfWeekFormat; - includeHour: Windows.Globalization.DateTimeFormatting.HourFormat; - includeMinute: Windows.Globalization.DateTimeFormatting.MinuteFormat; - includeMonth: Windows.Globalization.DateTimeFormatting.MonthFormat; - includeSecond: Windows.Globalization.DateTimeFormatting.SecondFormat; - includeYear: Windows.Globalization.DateTimeFormatting.YearFormat; - languages: Windows.Foundation.Collections.IVectorView; - numeralSystem: string; - patterns: Windows.Foundation.Collections.IVectorView; - resolvedGeographicRegion: string; - resolvedLanguage: string; - template: string; - format(value: Date): string; - } - export interface IDateTimeFormatterFactory { - createDateTimeFormatter(formatTemplate: string): Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - createDateTimeFormatterLanguages(formatTemplate: string, languages: Windows.Foundation.Collections.IIterable): Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - createDateTimeFormatterContext(formatTemplate: string, languages: Windows.Foundation.Collections.IIterable, geographicRegion: string, calendar: string, clock: string): Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - createDateTimeFormatterDate(yearFormat: Windows.Globalization.DateTimeFormatting.YearFormat, monthFormat: Windows.Globalization.DateTimeFormatting.MonthFormat, dayFormat: Windows.Globalization.DateTimeFormatting.DayFormat, dayOfWeekFormat: Windows.Globalization.DateTimeFormatting.DayOfWeekFormat): Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - createDateTimeFormatterTime(hourFormat: Windows.Globalization.DateTimeFormatting.HourFormat, minuteFormat: Windows.Globalization.DateTimeFormatting.MinuteFormat, secondFormat: Windows.Globalization.DateTimeFormatting.SecondFormat): Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - createDateTimeFormatterDateTimeLanguages(yearFormat: Windows.Globalization.DateTimeFormatting.YearFormat, monthFormat: Windows.Globalization.DateTimeFormatting.MonthFormat, dayFormat: Windows.Globalization.DateTimeFormatting.DayFormat, dayOfWeekFormat: Windows.Globalization.DateTimeFormatting.DayOfWeekFormat, hourFormat: Windows.Globalization.DateTimeFormatting.HourFormat, minuteFormat: Windows.Globalization.DateTimeFormatting.MinuteFormat, secondFormat: Windows.Globalization.DateTimeFormatting.SecondFormat, languages: Windows.Foundation.Collections.IIterable): Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - createDateTimeFormatterDateTimeContext(yearFormat: Windows.Globalization.DateTimeFormatting.YearFormat, monthFormat: Windows.Globalization.DateTimeFormatting.MonthFormat, dayFormat: Windows.Globalization.DateTimeFormatting.DayFormat, dayOfWeekFormat: Windows.Globalization.DateTimeFormatting.DayOfWeekFormat, hourFormat: Windows.Globalization.DateTimeFormatting.HourFormat, minuteFormat: Windows.Globalization.DateTimeFormatting.MinuteFormat, secondFormat: Windows.Globalization.DateTimeFormatting.SecondFormat, languages: Windows.Foundation.Collections.IIterable, geographicRegion: string, calendar: string, clock: string): Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - } - export class DateTimeFormatter implements Windows.Globalization.DateTimeFormatting.IDateTimeFormatter { - constructor(formatTemplate: string); - constructor(formatTemplate: string, languages: Windows.Foundation.Collections.IIterable); - constructor(formatTemplate: string, languages: Windows.Foundation.Collections.IIterable, geographicRegion: string, calendar: string, clock: string); - constructor(yearFormat: Windows.Globalization.DateTimeFormatting.YearFormat, monthFormat: Windows.Globalization.DateTimeFormatting.MonthFormat, dayFormat: Windows.Globalization.DateTimeFormatting.DayFormat, dayOfWeekFormat: Windows.Globalization.DateTimeFormatting.DayOfWeekFormat); - constructor(hourFormat: Windows.Globalization.DateTimeFormatting.HourFormat, minuteFormat: Windows.Globalization.DateTimeFormatting.MinuteFormat, secondFormat: Windows.Globalization.DateTimeFormatting.SecondFormat); - constructor(yearFormat: Windows.Globalization.DateTimeFormatting.YearFormat, monthFormat: Windows.Globalization.DateTimeFormatting.MonthFormat, dayFormat: Windows.Globalization.DateTimeFormatting.DayFormat, dayOfWeekFormat: Windows.Globalization.DateTimeFormatting.DayOfWeekFormat, hourFormat: Windows.Globalization.DateTimeFormatting.HourFormat, minuteFormat: Windows.Globalization.DateTimeFormatting.MinuteFormat, secondFormat: Windows.Globalization.DateTimeFormatting.SecondFormat, languages: Windows.Foundation.Collections.IIterable); - constructor(yearFormat: Windows.Globalization.DateTimeFormatting.YearFormat, monthFormat: Windows.Globalization.DateTimeFormatting.MonthFormat, dayFormat: Windows.Globalization.DateTimeFormatting.DayFormat, dayOfWeekFormat: Windows.Globalization.DateTimeFormatting.DayOfWeekFormat, hourFormat: Windows.Globalization.DateTimeFormatting.HourFormat, minuteFormat: Windows.Globalization.DateTimeFormatting.MinuteFormat, secondFormat: Windows.Globalization.DateTimeFormatting.SecondFormat, languages: Windows.Foundation.Collections.IIterable, geographicRegion: string, calendar: string, clock: string); - calendar: string; - clock: string; - geographicRegion: string; - includeDay: Windows.Globalization.DateTimeFormatting.DayFormat; - includeDayOfWeek: Windows.Globalization.DateTimeFormatting.DayOfWeekFormat; - includeHour: Windows.Globalization.DateTimeFormatting.HourFormat; - includeMinute: Windows.Globalization.DateTimeFormatting.MinuteFormat; - includeMonth: Windows.Globalization.DateTimeFormatting.MonthFormat; - includeSecond: Windows.Globalization.DateTimeFormatting.SecondFormat; - includeYear: Windows.Globalization.DateTimeFormatting.YearFormat; - languages: Windows.Foundation.Collections.IVectorView; - numeralSystem: string; - patterns: Windows.Foundation.Collections.IVectorView; - resolvedGeographicRegion: string; - resolvedLanguage: string; - template: string; - format(value: Date): string; - static longDate: Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - static longTime: Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - static shortDate: Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - static shortTime: Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - } - export interface IDateTimeFormatterStatics { - longDate: Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - longTime: Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - shortDate: Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - shortTime: Windows.Globalization.DateTimeFormatting.DateTimeFormatter; - } - } - } -} -declare module Windows { - export module Globalization { - export module NumberFormatting { - export interface INumberFormatter { - format(value: number): string; - } - export interface INumberFormatter2 { - formatInt(value: number): string; - formatUInt(value: number): string; - formatDouble(value: number): string; - } - export interface INumberParser { - parseInt(text: string): number; - parseUInt(text: string): number; - parseDouble(text: string): number; - } - export interface INumberFormatterOptions { - fractionDigits: number; - geographicRegion: string; - integerDigits: number; - isDecimalPointAlwaysDisplayed: boolean; - isGrouped: boolean; - languages: Windows.Foundation.Collections.IVectorView; - numeralSystem: string; - resolvedGeographicRegion: string; - resolvedLanguage: string; - } - export interface IDecimalFormatterFactory { - createDecimalFormatter(languages: Windows.Foundation.Collections.IIterable, geographicRegion: string): Windows.Globalization.NumberFormatting.DecimalFormatter; - } - export class DecimalFormatter implements Windows.Globalization.NumberFormatting.INumberFormatterOptions, Windows.Globalization.NumberFormatting.INumberFormatter, Windows.Globalization.NumberFormatting.INumberFormatter2, Windows.Globalization.NumberFormatting.INumberParser { - constructor(languages: Windows.Foundation.Collections.IIterable, geographicRegion: string); - constructor(); - fractionDigits: number; - geographicRegion: string; - integerDigits: number; - isDecimalPointAlwaysDisplayed: boolean; - isGrouped: boolean; - languages: Windows.Foundation.Collections.IVectorView; - numeralSystem: string; - resolvedGeographicRegion: string; - resolvedLanguage: string; - format(value: number): string; - formatInt(value: number): string; - formatUInt(value: number): string; - formatDouble(value: number): string; - parseInt(text: string): number; - parseUInt(text: string): number; - parseDouble(text: string): number; - } - export interface IPercentFormatterFactory { - createPercentFormatter(languages: Windows.Foundation.Collections.IIterable, geographicRegion: string): Windows.Globalization.NumberFormatting.PercentFormatter; - } - export class PercentFormatter implements Windows.Globalization.NumberFormatting.INumberFormatterOptions, Windows.Globalization.NumberFormatting.INumberFormatter, Windows.Globalization.NumberFormatting.INumberFormatter2, Windows.Globalization.NumberFormatting.INumberParser { - constructor(languages: Windows.Foundation.Collections.IIterable, geographicRegion: string); - constructor(); - fractionDigits: number; - geographicRegion: string; - integerDigits: number; - isDecimalPointAlwaysDisplayed: boolean; - isGrouped: boolean; - languages: Windows.Foundation.Collections.IVectorView; - numeralSystem: string; - resolvedGeographicRegion: string; - resolvedLanguage: string; - format(value: number): string; - formatInt(value: number): string; - formatUInt(value: number): string; - formatDouble(value: number): string; - parseInt(text: string): number; - parseUInt(text: string): number; - parseDouble(text: string): number; - } - export interface IPermilleFormatterFactory { - createPermilleFormatter(languages: Windows.Foundation.Collections.IIterable, geographicRegion: string): Windows.Globalization.NumberFormatting.PermilleFormatter; - } - export class PermilleFormatter implements Windows.Globalization.NumberFormatting.INumberFormatterOptions, Windows.Globalization.NumberFormatting.INumberFormatter, Windows.Globalization.NumberFormatting.INumberFormatter2, Windows.Globalization.NumberFormatting.INumberParser { - constructor(languages: Windows.Foundation.Collections.IIterable, geographicRegion: string); - constructor(); - fractionDigits: number; - geographicRegion: string; - integerDigits: number; - isDecimalPointAlwaysDisplayed: boolean; - isGrouped: boolean; - languages: Windows.Foundation.Collections.IVectorView; - numeralSystem: string; - resolvedGeographicRegion: string; - resolvedLanguage: string; - format(value: number): string; - formatInt(value: number): string; - formatUInt(value: number): string; - formatDouble(value: number): string; - parseInt(text: string): number; - parseUInt(text: string): number; - parseDouble(text: string): number; - } - export interface ICurrencyFormatterFactory { - createCurrencyFormatterCode(currencyCode: string): Windows.Globalization.NumberFormatting.CurrencyFormatter; - createCurrencyFormatterCodeContext(currencyCode: string, languages: Windows.Foundation.Collections.IIterable, geographicRegion: string): Windows.Globalization.NumberFormatting.CurrencyFormatter; - } - export class CurrencyFormatter implements Windows.Globalization.NumberFormatting.ICurrencyFormatter, Windows.Globalization.NumberFormatting.INumberFormatterOptions, Windows.Globalization.NumberFormatting.INumberFormatter, Windows.Globalization.NumberFormatting.INumberFormatter2, Windows.Globalization.NumberFormatting.INumberParser { - constructor(currencyCode: string); - constructor(currencyCode: string, languages: Windows.Foundation.Collections.IIterable, geographicRegion: string); - currency: string; - fractionDigits: number; - geographicRegion: string; - integerDigits: number; - isDecimalPointAlwaysDisplayed: boolean; - isGrouped: boolean; - languages: Windows.Foundation.Collections.IVectorView; - numeralSystem: string; - resolvedGeographicRegion: string; - resolvedLanguage: string; - format(value: number): string; - formatInt(value: number): string; - formatUInt(value: number): string; - formatDouble(value: number): string; - parseInt(text: string): number; - parseUInt(text: string): number; - parseDouble(text: string): number; - } - export interface ICurrencyFormatter extends Windows.Globalization.NumberFormatting.INumberFormatterOptions, Windows.Globalization.NumberFormatting.INumberFormatter, Windows.Globalization.NumberFormatting.INumberFormatter2, Windows.Globalization.NumberFormatting.INumberParser { - currency: string; - } - } - } -} -declare module Windows { - export module Globalization { - export module Collation { - export interface ICharacterGrouping { - first: string; - label: string; - } - export class CharacterGrouping implements Windows.Globalization.Collation.ICharacterGrouping { - first: string; - label: string; - } - export interface ICharacterGroupings extends Windows.Foundation.Collections.IVectorView, Windows.Foundation.Collections.IIterable { - lookup(text: string): string; - } - export class CharacterGroupings implements Windows.Globalization.Collation.ICharacterGroupings, Windows.Foundation.Collections.IVectorView, Windows.Foundation.Collections.IIterable { - size: number; - lookup(text: string): string; - getAt(index: number): Windows.Globalization.Collation.CharacterGrouping; - indexOf(value: Windows.Globalization.Collation.CharacterGrouping): { index: number; returnValue: boolean; }; - getMany(startIndex: number): { items: Windows.Globalization.Collation.CharacterGrouping[]; returnValue: number; }; - first(): Windows.Foundation.Collections.IIterator; - toString(): string; - toLocaleString(): string; - concat(...items: Windows.Globalization.Collation.CharacterGrouping[][]): Windows.Globalization.Collation.CharacterGrouping[]; - join(seperator: string): string; - pop(): Windows.Globalization.Collation.CharacterGrouping; - push(...items: Windows.Globalization.Collation.CharacterGrouping[]): void; - reverse(): Windows.Globalization.Collation.CharacterGrouping[]; - shift(): Windows.Globalization.Collation.CharacterGrouping; - slice(start: number): Windows.Globalization.Collation.CharacterGrouping[]; - slice(start: number, end: number): Windows.Globalization.Collation.CharacterGrouping[]; - sort(): Windows.Globalization.Collation.CharacterGrouping[]; - sort(compareFn: (a: Windows.Globalization.Collation.CharacterGrouping, b: Windows.Globalization.Collation.CharacterGrouping) => number): Windows.Globalization.Collation.CharacterGrouping[]; - splice(start: number): Windows.Globalization.Collation.CharacterGrouping[]; - splice(start: number, deleteCount: number, ...items: Windows.Globalization.Collation.CharacterGrouping[]): Windows.Globalization.Collation.CharacterGrouping[]; - unshift(...items: Windows.Globalization.Collation.CharacterGrouping[]): number; - lastIndexOf(searchElement: Windows.Globalization.Collation.CharacterGrouping): number; - lastIndexOf(searchElement: Windows.Globalization.Collation.CharacterGrouping, fromIndex: number): number; - every(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => boolean): boolean; - every(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => boolean): boolean; - some(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => void ): void; - forEach(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => void , thisArg: any): void; - map(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => any): any[]; - map(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => boolean): Windows.Globalization.Collation.CharacterGrouping[]; - filter(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => boolean, thisArg: any): Windows.Globalization.Collation.CharacterGrouping[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => any, initialValue: any): any; - length: number; - } - } - } -} -declare module Windows { - export module Graphics { - export module Display { - export interface DisplayPropertiesEventHandler { - (sender: any): void; - } - export enum DisplayOrientations { - none, - landscape, - portrait, - landscapeFlipped, - portraitFlipped, - } - export enum ResolutionScale { - invalid, - scale100Percent, - scale140Percent, - scale180Percent, - } - export interface IDisplayPropertiesStatics { - autoRotationPreferences: Windows.Graphics.Display.DisplayOrientations; - currentOrientation: Windows.Graphics.Display.DisplayOrientations; - logicalDpi: number; - nativeOrientation: Windows.Graphics.Display.DisplayOrientations; - resolutionScale: Windows.Graphics.Display.ResolutionScale; - stereoEnabled: boolean; - onorientationchanged: any/* TODO */; - onlogicaldpichanged: any/* TODO */; - onstereoenabledchanged: any/* TODO */; - getColorProfileAsync(): Windows.Foundation.IAsyncOperation; - oncolorprofilechanged: any/* TODO */; - ondisplaycontentsinvalidated: any/* TODO */; - } - export class DisplayProperties { - static autoRotationPreferences: Windows.Graphics.Display.DisplayOrientations; - static currentOrientation: Windows.Graphics.Display.DisplayOrientations; - static logicalDpi: number; - static nativeOrientation: Windows.Graphics.Display.DisplayOrientations; - static resolutionScale: Windows.Graphics.Display.ResolutionScale; - static stereoEnabled: boolean; - static onorientationchanged: any/* TODO */; - static onlogicaldpichanged: any/* TODO */; - static onstereoenabledchanged: any/* TODO */; - static getColorProfileAsync(): Windows.Foundation.IAsyncOperation; - static oncolorprofilechanged: any/* TODO */; - static ondisplaycontentsinvalidated: any/* TODO */; - } - } - } -} -declare module Windows { - export module Graphics { - export module Imaging { - export enum BitmapPixelFormat { - unknown, - rgba16, - rgba8, - bgra8, - } - export enum BitmapAlphaMode { - premultiplied, - straight, - ignore, - } - export enum BitmapInterpolationMode { - nearestNeighbor, - linear, - cubic, - fant, - } - export enum BitmapFlip { - none, - horizontal, - vertical, - } - export enum BitmapRotation { - none, - clockwise90Degrees, - clockwise180Degrees, - clockwise270Degrees, - } - export interface BitmapBounds { - x: number; - y: number; - width: number; - height: number; - } - export enum ColorManagementMode { - doNotColorManage, - colorManageToSRgb, - } - export enum ExifOrientationMode { - ignoreExifOrientation, - respectExifOrientation, - } - export enum PngFilterMode { - automatic, - none, - sub, - up, - average, - paeth, - adaptive, - } - export enum TiffCompressionMode { - automatic, - none, - ccitt3, - ccitt4, - lzw, - rle, - zip, - lzwhDifferencing, - } - export enum JpegSubsamplingMode { - default, - y4Cb2Cr0, - y4Cb2Cr2, - y4Cb4Cr4, - } - export interface IBitmapTransform { - bounds: Windows.Graphics.Imaging.BitmapBounds; - flip: Windows.Graphics.Imaging.BitmapFlip; - interpolationMode: Windows.Graphics.Imaging.BitmapInterpolationMode; - rotation: Windows.Graphics.Imaging.BitmapRotation; - scaledHeight: number; - scaledWidth: number; - } - export class BitmapTransform implements Windows.Graphics.Imaging.IBitmapTransform { - bounds: Windows.Graphics.Imaging.BitmapBounds; - flip: Windows.Graphics.Imaging.BitmapFlip; - interpolationMode: Windows.Graphics.Imaging.BitmapInterpolationMode; - rotation: Windows.Graphics.Imaging.BitmapRotation; - scaledHeight: number; - scaledWidth: number; - } - export interface IBitmapTypedValue { - type: Windows.Foundation.PropertyType; - value: any; - } - export interface IBitmapTypedValueFactory { - create(value: any, type: Windows.Foundation.PropertyType): Windows.Graphics.Imaging.BitmapTypedValue; - } - export class BitmapTypedValue implements Windows.Graphics.Imaging.IBitmapTypedValue { - constructor(value: any, type: Windows.Foundation.PropertyType); - type: Windows.Foundation.PropertyType; - value: any; - } - export class BitmapPropertySet implements Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { - size: number; - lookup(key: string): Windows.Graphics.Imaging.BitmapTypedValue; - hasKey(key: string): boolean; - getView(): Windows.Foundation.Collections.IMapView; - insert(key: string, value: Windows.Graphics.Imaging.BitmapTypedValue): boolean; - remove(key: string): void; - clear(): void; - first(): Windows.Foundation.Collections.IIterator>; - } - export interface IBitmapPropertiesView { - getPropertiesAsync(propertiesToRetrieve: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation; - } - export interface IBitmapProperties extends Windows.Graphics.Imaging.IBitmapPropertiesView { - setPropertiesAsync(propertiesToSet: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IAsyncAction; - } - export class BitmapPropertiesView implements Windows.Graphics.Imaging.IBitmapPropertiesView { - getPropertiesAsync(propertiesToRetrieve: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation; - } - export class BitmapProperties implements Windows.Graphics.Imaging.IBitmapProperties, Windows.Graphics.Imaging.IBitmapPropertiesView { - setPropertiesAsync(propertiesToSet: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IAsyncAction; - getPropertiesAsync(propertiesToRetrieve: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation; - } - export interface IPixelDataProvider { - detachPixelData(): Uint8Array; - } - export class PixelDataProvider implements Windows.Graphics.Imaging.IPixelDataProvider { - detachPixelData(): Uint8Array; - } - export class ImageStream implements Windows.Storage.Streams.IRandomAccessStreamWithContentType, Windows.Storage.Streams.IRandomAccessStream, Windows.Foundation.IClosable, Windows.Storage.Streams.IInputStream, Windows.Storage.Streams.IOutputStream, Windows.Storage.Streams.IContentTypeProvider { - canRead: boolean; - canWrite: boolean; - position: number; - size: number; - contentType: string; - getInputStreamAt(position: number): Windows.Storage.Streams.IInputStream; - getOutputStreamAt(position: number): Windows.Storage.Streams.IOutputStream; - seek(position: number): void; - cloneStream(): Windows.Storage.Streams.IRandomAccessStream; - dispose(): void; - readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IAsyncOperationWithProgress; - writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperationWithProgress; - flushAsync(): Windows.Foundation.IAsyncOperation; - close(): void; - } - export interface IBitmapFrame { - bitmapAlphaMode: Windows.Graphics.Imaging.BitmapAlphaMode; - bitmapPixelFormat: Windows.Graphics.Imaging.BitmapPixelFormat; - bitmapProperties: Windows.Graphics.Imaging.BitmapPropertiesView; - dpiX: number; - dpiY: number; - orientedPixelHeight: number; - orientedPixelWidth: number; - pixelHeight: number; - pixelWidth: number; - getThumbnailAsync(): Windows.Foundation.IAsyncOperation; - getPixelDataAsync(): Windows.Foundation.IAsyncOperation; - getPixelDataAsync(pixelFormat: Windows.Graphics.Imaging.BitmapPixelFormat, alphaMode: Windows.Graphics.Imaging.BitmapAlphaMode, transform: Windows.Graphics.Imaging.BitmapTransform, exifOrientationMode: Windows.Graphics.Imaging.ExifOrientationMode, colorManagementMode: Windows.Graphics.Imaging.ColorManagementMode): Windows.Foundation.IAsyncOperation; - } - export class BitmapFrame implements Windows.Graphics.Imaging.IBitmapFrame { - bitmapAlphaMode: Windows.Graphics.Imaging.BitmapAlphaMode; - bitmapPixelFormat: Windows.Graphics.Imaging.BitmapPixelFormat; - bitmapProperties: Windows.Graphics.Imaging.BitmapPropertiesView; - dpiX: number; - dpiY: number; - orientedPixelHeight: number; - orientedPixelWidth: number; - pixelHeight: number; - pixelWidth: number; - getThumbnailAsync(): Windows.Foundation.IAsyncOperation; - getPixelDataAsync(): Windows.Foundation.IAsyncOperation; - getPixelDataAsync(pixelFormat: Windows.Graphics.Imaging.BitmapPixelFormat, alphaMode: Windows.Graphics.Imaging.BitmapAlphaMode, transform: Windows.Graphics.Imaging.BitmapTransform, exifOrientationMode: Windows.Graphics.Imaging.ExifOrientationMode, colorManagementMode: Windows.Graphics.Imaging.ColorManagementMode): Windows.Foundation.IAsyncOperation; - } - export interface IBitmapCodecInformation { - codecId: string; - fileExtensions: Windows.Foundation.Collections.IVectorView; - friendlyName: string; - mimeTypes: Windows.Foundation.Collections.IVectorView; - } - export class BitmapCodecInformation implements Windows.Graphics.Imaging.IBitmapCodecInformation { - codecId: string; - fileExtensions: Windows.Foundation.Collections.IVectorView; - friendlyName: string; - mimeTypes: Windows.Foundation.Collections.IVectorView; - } - export interface IBitmapDecoderStatics { - bmpDecoderId: string; - gifDecoderId: string; - icoDecoderId: string; - jpegDecoderId: string; - jpegXRDecoderId: string; - pngDecoderId: string; - tiffDecoderId: string; - getDecoderInformationEnumerator(): Windows.Foundation.Collections.IVectorView; - createAsync(stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncOperation; - createAsync(decoderId: string, stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncOperation; - } - export class BitmapDecoder implements Windows.Graphics.Imaging.IBitmapDecoder, Windows.Graphics.Imaging.IBitmapFrame { - bitmapContainerProperties: Windows.Graphics.Imaging.BitmapPropertiesView; - decoderInformation: Windows.Graphics.Imaging.BitmapCodecInformation; - frameCount: number; - bitmapAlphaMode: Windows.Graphics.Imaging.BitmapAlphaMode; - bitmapPixelFormat: Windows.Graphics.Imaging.BitmapPixelFormat; - bitmapProperties: Windows.Graphics.Imaging.BitmapPropertiesView; - dpiX: number; - dpiY: number; - orientedPixelHeight: number; - orientedPixelWidth: number; - pixelHeight: number; - pixelWidth: number; - getPreviewAsync(): Windows.Foundation.IAsyncOperation; - getFrameAsync(frameIndex: number): Windows.Foundation.IAsyncOperation; - getThumbnailAsync(): Windows.Foundation.IAsyncOperation; - getPixelDataAsync(): Windows.Foundation.IAsyncOperation; - getPixelDataAsync(pixelFormat: Windows.Graphics.Imaging.BitmapPixelFormat, alphaMode: Windows.Graphics.Imaging.BitmapAlphaMode, transform: Windows.Graphics.Imaging.BitmapTransform, exifOrientationMode: Windows.Graphics.Imaging.ExifOrientationMode, colorManagementMode: Windows.Graphics.Imaging.ColorManagementMode): Windows.Foundation.IAsyncOperation; - static bmpDecoderId: string; - static gifDecoderId: string; - static icoDecoderId: string; - static jpegDecoderId: string; - static jpegXRDecoderId: string; - static pngDecoderId: string; - static tiffDecoderId: string; - static getDecoderInformationEnumerator(): Windows.Foundation.Collections.IVectorView; - static createAsync(stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncOperation; - static createAsync(decoderId: string, stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncOperation; - } - export interface IBitmapDecoder { - bitmapContainerProperties: Windows.Graphics.Imaging.BitmapPropertiesView; - decoderInformation: Windows.Graphics.Imaging.BitmapCodecInformation; - frameCount: number; - getPreviewAsync(): Windows.Foundation.IAsyncOperation; - getFrameAsync(frameIndex: number): Windows.Foundation.IAsyncOperation; - } - export interface IBitmapEncoderStatics { - bmpEncoderId: string; - gifEncoderId: string; - jpegEncoderId: string; - jpegXREncoderId: string; - pngEncoderId: string; - tiffEncoderId: string; - getEncoderInformationEnumerator(): Windows.Foundation.Collections.IVectorView; - createAsync(encoderId: string, stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncOperation; - createAsync(encoderId: string, stream: Windows.Storage.Streams.IRandomAccessStream, encodingOptions: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IAsyncOperation; - createForTranscodingAsync(stream: Windows.Storage.Streams.IRandomAccessStream, bitmapDecoder: Windows.Graphics.Imaging.BitmapDecoder): Windows.Foundation.IAsyncOperation; - createForInPlacePropertyEncodingAsync(bitmapDecoder: Windows.Graphics.Imaging.BitmapDecoder): Windows.Foundation.IAsyncOperation; - } - export class BitmapEncoder implements Windows.Graphics.Imaging.IBitmapEncoder { - bitmapContainerProperties: Windows.Graphics.Imaging.BitmapProperties; - bitmapProperties: Windows.Graphics.Imaging.BitmapProperties; - bitmapTransform: Windows.Graphics.Imaging.BitmapTransform; - encoderInformation: Windows.Graphics.Imaging.BitmapCodecInformation; - generatedThumbnailHeight: number; - generatedThumbnailWidth: number; - isThumbnailGenerated: boolean; - setPixelData(pixelFormat: Windows.Graphics.Imaging.BitmapPixelFormat, alphaMode: Windows.Graphics.Imaging.BitmapAlphaMode, width: number, height: number, dpiX: number, dpiY: number, pixels: Uint8Array): void; - goToNextFrameAsync(): Windows.Foundation.IAsyncAction; - goToNextFrameAsync(encodingOptions: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IAsyncAction; - flushAsync(): Windows.Foundation.IAsyncAction; - static bmpEncoderId: string; - static gifEncoderId: string; - static jpegEncoderId: string; - static jpegXREncoderId: string; - static pngEncoderId: string; - static tiffEncoderId: string; - static getEncoderInformationEnumerator(): Windows.Foundation.Collections.IVectorView; - static createAsync(encoderId: string, stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncOperation; - static createAsync(encoderId: string, stream: Windows.Storage.Streams.IRandomAccessStream, encodingOptions: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IAsyncOperation; - static createForTranscodingAsync(stream: Windows.Storage.Streams.IRandomAccessStream, bitmapDecoder: Windows.Graphics.Imaging.BitmapDecoder): Windows.Foundation.IAsyncOperation; - static createForInPlacePropertyEncodingAsync(bitmapDecoder: Windows.Graphics.Imaging.BitmapDecoder): Windows.Foundation.IAsyncOperation; - } - export interface IBitmapEncoder { - bitmapContainerProperties: Windows.Graphics.Imaging.BitmapProperties; - bitmapProperties: Windows.Graphics.Imaging.BitmapProperties; - bitmapTransform: Windows.Graphics.Imaging.BitmapTransform; - encoderInformation: Windows.Graphics.Imaging.BitmapCodecInformation; - generatedThumbnailHeight: number; - generatedThumbnailWidth: number; - isThumbnailGenerated: boolean; - setPixelData(pixelFormat: Windows.Graphics.Imaging.BitmapPixelFormat, alphaMode: Windows.Graphics.Imaging.BitmapAlphaMode, width: number, height: number, dpiX: number, dpiY: number, pixels: Uint8Array): void; - goToNextFrameAsync(): Windows.Foundation.IAsyncAction; - goToNextFrameAsync(encodingOptions: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IAsyncAction; - flushAsync(): Windows.Foundation.IAsyncAction; - } - } - } -} -declare module Windows { - export module Graphics { - export module Printing { - export module OptionDetails { - export enum PrintOptionStates { - none, - enabled, - constrained, - } - export enum PrintOptionType { - unknown, - number, - text, - itemList, - } - export interface IPrintOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - trySetValue(value: any): boolean; - } - export interface IPrintNumberOptionDetails extends Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails { - maxValue: number; - minValue: number; - } - export interface IPrintTextOptionDetails extends Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails { - maxCharacters: number; - } - export interface IPrintItemListOptionDetails extends Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails { - items: Windows.Foundation.Collections.IVectorView; - } - export class PrintCopiesOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintNumberOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - maxValue: number; - minValue: number; - trySetValue(value: any): boolean; - } - export class PrintMediaSizeOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintItemListOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - items: Windows.Foundation.Collections.IVectorView; - trySetValue(value: any): boolean; - } - export class PrintMediaTypeOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintItemListOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - items: Windows.Foundation.Collections.IVectorView; - trySetValue(value: any): boolean; - } - export class PrintOrientationOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintItemListOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - items: Windows.Foundation.Collections.IVectorView; - trySetValue(value: any): boolean; - } - export class PrintQualityOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintItemListOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - items: Windows.Foundation.Collections.IVectorView; - trySetValue(value: any): boolean; - } - export class PrintColorModeOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintItemListOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - items: Windows.Foundation.Collections.IVectorView; - trySetValue(value: any): boolean; - } - export class PrintDuplexOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintItemListOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - items: Windows.Foundation.Collections.IVectorView; - trySetValue(value: any): boolean; - } - export class PrintCollationOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintItemListOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - items: Windows.Foundation.Collections.IVectorView; - trySetValue(value: any): boolean; - } - export class PrintStapleOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintItemListOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - items: Windows.Foundation.Collections.IVectorView; - trySetValue(value: any): boolean; - } - export class PrintHolePunchOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintItemListOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - items: Windows.Foundation.Collections.IVectorView; - trySetValue(value: any): boolean; - } - export class PrintBindingOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintItemListOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - items: Windows.Foundation.Collections.IVectorView; - trySetValue(value: any): boolean; - } - export interface IPrintCustomOptionDetails extends Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails { - displayName: string; - } - export interface IPrintCustomTextOptionDetails extends Windows.Graphics.Printing.OptionDetails.IPrintCustomOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails { - maxCharacters: number; - } - export class PrintCustomTextOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintCustomOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintCustomTextOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - displayName: string; - maxCharacters: number; - trySetValue(value: any): boolean; - } - export interface IPrintCustomItemDetails { - itemDisplayName: string; - itemId: string; - } - export class PrintCustomItemDetails implements Windows.Graphics.Printing.OptionDetails.IPrintCustomItemDetails { - itemDisplayName: string; - itemId: string; - } - export interface IPrintCustomItemListOptionDetails extends Windows.Graphics.Printing.OptionDetails.IPrintItemListOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintCustomOptionDetails { - addItem(itemId: string, displayName: string): void; - } - export class PrintCustomItemListOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintCustomOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintItemListOptionDetails, Windows.Graphics.Printing.OptionDetails.IPrintCustomItemListOptionDetails { - errorText: string; - optionId: string; - optionType: Windows.Graphics.Printing.OptionDetails.PrintOptionType; - state: Windows.Graphics.Printing.OptionDetails.PrintOptionStates; - value: any; - displayName: string; - items: Windows.Foundation.Collections.IVectorView; - trySetValue(value: any): boolean; - addItem(itemId: string, displayName: string): void; - } - export interface IPrintTaskOptionChangedEventArgs { - optionId: any; - } - export class PrintTaskOptionChangedEventArgs implements Windows.Graphics.Printing.OptionDetails.IPrintTaskOptionChangedEventArgs { - optionId: any; - } - export interface IPrintTaskOptionDetails { - options: Windows.Foundation.Collections.IMapView; - createItemListOption(optionId: string, displayName: string): Windows.Graphics.Printing.OptionDetails.PrintCustomItemListOptionDetails; - createTextOption(optionId: string, displayName: string): Windows.Graphics.Printing.OptionDetails.PrintCustomTextOptionDetails; - onoptionchanged: any/* TODO */; - onbeginvalidation: any/* TODO */; - } - export class PrintTaskOptionDetails implements Windows.Graphics.Printing.OptionDetails.IPrintTaskOptionDetails, Windows.Graphics.Printing.IPrintTaskOptionsCore, Windows.Graphics.Printing.IPrintTaskOptionsCoreUIConfiguration { - options: Windows.Foundation.Collections.IMapView; - displayedOptions: Windows.Foundation.Collections.IVector; - createItemListOption(optionId: string, displayName: string): Windows.Graphics.Printing.OptionDetails.PrintCustomItemListOptionDetails; - createTextOption(optionId: string, displayName: string): Windows.Graphics.Printing.OptionDetails.PrintCustomTextOptionDetails; - onoptionchanged: any/* TODO */; - onbeginvalidation: any/* TODO */; - getPageDescription(jobPageNumber: number): Windows.Graphics.Printing.PrintPageDescription; - static getFromPrintTaskOptions(printTaskOptions: Windows.Graphics.Printing.PrintTaskOptions): Windows.Graphics.Printing.OptionDetails.PrintTaskOptionDetails; - } - export interface IPrintTaskOptionDetailsStatic { - getFromPrintTaskOptions(printTaskOptions: Windows.Graphics.Printing.PrintTaskOptions): Windows.Graphics.Printing.OptionDetails.PrintTaskOptionDetails; - } - } - } - } -} -declare module Windows { - export module Graphics { - export module Printing { - export interface PrintPageDescription { - pageSize: Windows.Foundation.Size; - imageableRect: Windows.Foundation.Rect; - dpiX: number; - dpiY: number; - } - export enum PrintMediaSize { - default, - notAvailable, - printerCustom, - businessCard, - creditCard, - isoA0, - isoA1, - isoA10, - isoA2, - isoA3, - isoA3Extra, - isoA3Rotated, - isoA4, - isoA4Extra, - isoA4Rotated, - isoA5, - isoA5Extra, - isoA5Rotated, - isoA6, - isoA6Rotated, - isoA7, - isoA8, - isoA9, - isoB0, - isoB1, - isoB10, - isoB2, - isoB3, - isoB4, - isoB4Envelope, - isoB5Envelope, - isoB5Extra, - isoB7, - isoB8, - isoB9, - isoC0, - isoC1, - isoC10, - isoC2, - isoC3, - isoC3Envelope, - isoC4, - isoC4Envelope, - isoC5, - isoC5Envelope, - isoC6, - isoC6C5Envelope, - isoC6Envelope, - isoC7, - isoC8, - isoC9, - isoDLEnvelope, - isoDLEnvelopeRotated, - isoSRA3, - japan2LPhoto, - japanChou3Envelope, - japanChou3EnvelopeRotated, - japanChou4Envelope, - japanChou4EnvelopeRotated, - japanDoubleHagakiPostcard, - japanDoubleHagakiPostcardRotated, - japanHagakiPostcard, - japanHagakiPostcardRotated, - japanKaku2Envelope, - japanKaku2EnvelopeRotated, - japanKaku3Envelope, - japanKaku3EnvelopeRotated, - japanLPhoto, - japanQuadrupleHagakiPostcard, - japanYou1Envelope, - japanYou2Envelope, - japanYou3Envelope, - japanYou4Envelope, - japanYou4EnvelopeRotated, - japanYou6Envelope, - japanYou6EnvelopeRotated, - jisB0, - jisB1, - jisB10, - jisB2, - jisB3, - jisB4, - jisB4Rotated, - jisB5, - jisB5Rotated, - jisB6, - jisB6Rotated, - jisB7, - jisB8, - jisB9, - northAmerica10x11, - northAmerica10x12, - northAmerica10x14, - northAmerica11x17, - northAmerica14x17, - northAmerica4x6, - northAmerica4x8, - northAmerica5x7, - northAmerica8x10, - northAmerica9x11, - northAmericaArchitectureASheet, - northAmericaArchitectureBSheet, - northAmericaArchitectureCSheet, - northAmericaArchitectureDSheet, - northAmericaArchitectureESheet, - northAmericaCSheet, - northAmericaDSheet, - northAmericaESheet, - northAmericaExecutive, - northAmericaGermanLegalFanfold, - northAmericaGermanStandardFanfold, - northAmericaLegal, - northAmericaLegalExtra, - northAmericaLetter, - northAmericaLetterExtra, - northAmericaLetterPlus, - northAmericaLetterRotated, - northAmericaMonarchEnvelope, - northAmericaNote, - northAmericaNumber10Envelope, - northAmericaNumber10EnvelopeRotated, - northAmericaNumber11Envelope, - northAmericaNumber12Envelope, - northAmericaNumber14Envelope, - northAmericaNumber9Envelope, - northAmericaPersonalEnvelope, - northAmericaQuarto, - northAmericaStatement, - northAmericaSuperA, - northAmericaSuperB, - northAmericaTabloid, - northAmericaTabloidExtra, - otherMetricA3Plus, - otherMetricA4Plus, - otherMetricFolio, - otherMetricInviteEnvelope, - otherMetricItalianEnvelope, - prc10Envelope, - prc10EnvelopeRotated, - prc16K, - prc16KRotated, - prc1Envelope, - prc1EnvelopeRotated, - prc2Envelope, - prc2EnvelopeRotated, - prc32K, - prc32KBig, - prc32KRotated, - prc3Envelope, - prc3EnvelopeRotated, - prc4Envelope, - prc4EnvelopeRotated, - prc5Envelope, - prc5EnvelopeRotated, - prc6Envelope, - prc6EnvelopeRotated, - prc7Envelope, - prc7EnvelopeRotated, - prc8Envelope, - prc8EnvelopeRotated, - prc9Envelope, - prc9EnvelopeRotated, - roll04Inch, - roll06Inch, - roll08Inch, - roll12Inch, - roll15Inch, - roll18Inch, - roll22Inch, - roll24Inch, - roll30Inch, - roll36Inch, - roll54Inch, - } - export enum PrintMediaType { - default, - notAvailable, - printerCustom, - autoSelect, - archival, - backPrintFilm, - bond, - cardStock, - continuous, - envelopePlain, - envelopeWindow, - fabric, - highResolution, - label, - multiLayerForm, - multiPartForm, - photographic, - photographicFilm, - photographicGlossy, - photographicHighGloss, - photographicMatte, - photographicSatin, - photographicSemiGloss, - plain, - screen, - screenPaged, - stationery, - tabStockFull, - tabStockPreCut, - transparency, - tShirtTransfer, - none, - } - export enum PrintOrientation { - default, - notAvailable, - printerCustom, - portrait, - portraitFlipped, - landscape, - landscapeFlipped, - } - export enum PrintQuality { - default, - notAvailable, - printerCustom, - automatic, - draft, - fax, - high, - normal, - photographic, - text, - } - export enum PrintColorMode { - default, - notAvailable, - printerCustom, - color, - grayscale, - monochrome, - } - export enum PrintDuplex { - default, - notAvailable, - printerCustom, - oneSided, - twoSidedShortEdge, - twoSidedLongEdge, - } - export enum PrintCollation { - default, - notAvailable, - printerCustom, - collated, - uncollated, - } - export enum PrintStaple { - default, - notAvailable, - printerCustom, - none, - stapleTopLeft, - stapleTopRight, - stapleBottomLeft, - stapleBottomRight, - stapleDualLeft, - stapleDualRight, - stapleDualTop, - stapleDualBottom, - saddleStitch, - } - export enum PrintHolePunch { - default, - notAvailable, - printerCustom, - none, - leftEdge, - rightEdge, - topEdge, - bottomEdge, - } - export enum PrintBinding { - default, - notAvailable, - printerCustom, - none, - bale, - bindBottom, - bindLeft, - bindRight, - bindTop, - booklet, - edgeStitchBottom, - edgeStitchLeft, - edgeStitchRight, - edgeStitchTop, - fold, - jogOffset, - trim, - } - export interface IPrintTaskOptionsCoreProperties { - binding: Windows.Graphics.Printing.PrintBinding; - collation: Windows.Graphics.Printing.PrintCollation; - colorMode: Windows.Graphics.Printing.PrintColorMode; - duplex: Windows.Graphics.Printing.PrintDuplex; - holePunch: Windows.Graphics.Printing.PrintHolePunch; - maxCopies: number; - mediaSize: Windows.Graphics.Printing.PrintMediaSize; - mediaType: Windows.Graphics.Printing.PrintMediaType; - minCopies: number; - numberOfCopies: number; - orientation: Windows.Graphics.Printing.PrintOrientation; - printQuality: Windows.Graphics.Printing.PrintQuality; - staple: Windows.Graphics.Printing.PrintStaple; - } - export interface IPrintTaskOptionsCoreUIConfiguration { - displayedOptions: Windows.Foundation.Collections.IVector; - } - export interface IPrintTaskOptionsCore { - getPageDescription(jobPageNumber: number): Windows.Graphics.Printing.PrintPageDescription; - } - export class PrintTaskOptions implements Windows.Graphics.Printing.IPrintTaskOptionsCore, Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties, Windows.Graphics.Printing.IPrintTaskOptionsCoreUIConfiguration { - binding: Windows.Graphics.Printing.PrintBinding; - collation: Windows.Graphics.Printing.PrintCollation; - colorMode: Windows.Graphics.Printing.PrintColorMode; - duplex: Windows.Graphics.Printing.PrintDuplex; - holePunch: Windows.Graphics.Printing.PrintHolePunch; - maxCopies: number; - mediaSize: Windows.Graphics.Printing.PrintMediaSize; - mediaType: Windows.Graphics.Printing.PrintMediaType; - minCopies: number; - numberOfCopies: number; - orientation: Windows.Graphics.Printing.PrintOrientation; - printQuality: Windows.Graphics.Printing.PrintQuality; - staple: Windows.Graphics.Printing.PrintStaple; - displayedOptions: Windows.Foundation.Collections.IVector; - getPageDescription(jobPageNumber: number): Windows.Graphics.Printing.PrintPageDescription; - } - export interface IStandardPrintTaskOptionsStatic { - binding: string; - collation: string; - colorMode: string; - copies: string; - duplex: string; - holePunch: string; - inputBin: string; - mediaSize: string; - mediaType: string; - nUp: string; - orientation: string; - printQuality: string; - staple: string; - } - export class StandardPrintTaskOptions { - static binding: string; - static collation: string; - static colorMode: string; - static copies: string; - static duplex: string; - static holePunch: string; - static inputBin: string; - static mediaSize: string; - static mediaType: string; - static nUp: string; - static orientation: string; - static printQuality: string; - static staple: string; - } - export interface IPrintDocumentSource { - } - export interface IPrintTaskProgressingEventArgs { - documentPageCount: number; - } - export class PrintTaskProgressingEventArgs implements Windows.Graphics.Printing.IPrintTaskProgressingEventArgs { - documentPageCount: number; - } - export enum PrintTaskCompletion { - abandoned, - canceled, - failed, - submitted, - } - export interface IPrintTaskCompletedEventArgs { - completion: Windows.Graphics.Printing.PrintTaskCompletion; - } - export class PrintTaskCompletedEventArgs implements Windows.Graphics.Printing.IPrintTaskCompletedEventArgs { - completion: Windows.Graphics.Printing.PrintTaskCompletion; - } - export interface IPrintTask { - options: Windows.Graphics.Printing.PrintTaskOptions; - properties: Windows.ApplicationModel.DataTransfer.DataPackagePropertySet; - source: Windows.Graphics.Printing.IPrintDocumentSource; - onpreviewing: any/* TODO */; - onsubmitting: any/* TODO */; - onprogressing: any/* TODO */; - oncompleted: any/* TODO */; - } - export class PrintTask implements Windows.Graphics.Printing.IPrintTask { - options: Windows.Graphics.Printing.PrintTaskOptions; - properties: Windows.ApplicationModel.DataTransfer.DataPackagePropertySet; - source: Windows.Graphics.Printing.IPrintDocumentSource; - onpreviewing: any/* TODO */; - onsubmitting: any/* TODO */; - onprogressing: any/* TODO */; - oncompleted: any/* TODO */; - } - export interface IPrintTaskSourceRequestedDeferral { - complete(): void; - } - export class PrintTaskSourceRequestedDeferral implements Windows.Graphics.Printing.IPrintTaskSourceRequestedDeferral { - complete(): void; - } - export interface IPrintTaskSourceRequestedArgs { - deadline: Date; - setSource(source: Windows.Graphics.Printing.IPrintDocumentSource): void; - getDeferral(): Windows.Graphics.Printing.PrintTaskSourceRequestedDeferral; - } - export class PrintTaskSourceRequestedArgs implements Windows.Graphics.Printing.IPrintTaskSourceRequestedArgs { - deadline: Date; - setSource(source: Windows.Graphics.Printing.IPrintDocumentSource): void; - getDeferral(): Windows.Graphics.Printing.PrintTaskSourceRequestedDeferral; - } - export interface PrintTaskSourceRequestedHandler { - (args: Windows.Graphics.Printing.PrintTaskSourceRequestedArgs): void; - } - export interface IPrintTaskRequestedDeferral { - complete(): void; - } - export class PrintTaskRequestedDeferral implements Windows.Graphics.Printing.IPrintTaskRequestedDeferral { - complete(): void; - } - export interface IPrintTaskRequest { - deadline: Date; - createPrintTask(title: string, handler: Windows.Graphics.Printing.PrintTaskSourceRequestedHandler): Windows.Graphics.Printing.PrintTask; - getDeferral(): Windows.Graphics.Printing.PrintTaskRequestedDeferral; - } - export class PrintTaskRequest implements Windows.Graphics.Printing.IPrintTaskRequest { - deadline: Date; - createPrintTask(title: string, handler: Windows.Graphics.Printing.PrintTaskSourceRequestedHandler): Windows.Graphics.Printing.PrintTask; - getDeferral(): Windows.Graphics.Printing.PrintTaskRequestedDeferral; - } - export interface IPrintTaskRequestedEventArgs { - request: Windows.Graphics.Printing.PrintTaskRequest; - } - export class PrintTaskRequestedEventArgs implements Windows.Graphics.Printing.IPrintTaskRequestedEventArgs { - request: Windows.Graphics.Printing.PrintTaskRequest; - } - export interface IPrintManagerStatic { - getForCurrentView(): Windows.Graphics.Printing.PrintManager; - showPrintUIAsync(): Windows.Foundation.IAsyncOperation; - } - export class PrintManager implements Windows.Graphics.Printing.IPrintManager { - onprinttaskrequested: any/* TODO */; - static getForCurrentView(): Windows.Graphics.Printing.PrintManager; - static showPrintUIAsync(): Windows.Foundation.IAsyncOperation; - } - export interface IPrintManager { - onprinttaskrequested: any/* TODO */; - } - } - } -} -declare module Windows { - export module Management { - export module Deployment { - export enum DeploymentProgressState { - queued, - processing, - } - export interface DeploymentProgress { - state: Windows.Management.Deployment.DeploymentProgressState; - percentage: number; - } - export enum DeploymentOptions { - none, - forceApplicationShutdown, - developmentMode, - } - export interface IDeploymentResult { - activityId: string; - errorText: string; - extendedErrorCode: number; - } - export class DeploymentResult implements Windows.Management.Deployment.IDeploymentResult { - activityId: string; - errorText: string; - extendedErrorCode: number; - } - export enum PackageInstallState { - notInstalled, - staged, - installed, - } - export interface IPackageUserInformation { - installState: Windows.Management.Deployment.PackageInstallState; - userSecurityId: string; - } - export class PackageUserInformation implements Windows.Management.Deployment.IPackageUserInformation { - installState: Windows.Management.Deployment.PackageInstallState; - userSecurityId: string; - } - export enum PackageState { - normal, - licenseInvalid, - modified, - tampered, - } - export interface IPackageManager { - addPackageAsync(packageUri: Windows.Foundation.Uri, dependencyPackageUris: Windows.Foundation.Collections.IIterable, deploymentOptions: Windows.Management.Deployment.DeploymentOptions): Windows.Foundation.IAsyncOperationWithProgress; - updatePackageAsync(packageUri: Windows.Foundation.Uri, dependencyPackageUris: Windows.Foundation.Collections.IIterable, deploymentOptions: Windows.Management.Deployment.DeploymentOptions): Windows.Foundation.IAsyncOperationWithProgress; - removePackageAsync(packageFullName: string): Windows.Foundation.IAsyncOperationWithProgress; - stagePackageAsync(packageUri: Windows.Foundation.Uri, dependencyPackageUris: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperationWithProgress; - registerPackageAsync(manifestUri: Windows.Foundation.Uri, dependencyPackageUris: Windows.Foundation.Collections.IIterable, deploymentOptions: Windows.Management.Deployment.DeploymentOptions): Windows.Foundation.IAsyncOperationWithProgress; - findPackages(): Windows.Foundation.Collections.IIterable; - findPackagesForUser(userSecurityId: string): Windows.Foundation.Collections.IIterable; - findPackages(packageName: string, packagePublisher: string): Windows.Foundation.Collections.IIterable; - findPackagesForUser(userSecurityId: string, packageName: string, packagePublisher: string): Windows.Foundation.Collections.IIterable; - findUsers(packageFullName: string): Windows.Foundation.Collections.IIterable; - setPackageState(packageFullName: string, packageState: Windows.Management.Deployment.PackageState): void; - findPackage(packageFullName: string): Windows.ApplicationModel.Package; - cleanupPackageForUserAsync(packageName: string, userSecurityId: string): Windows.Foundation.IAsyncOperationWithProgress; - findPackages(packageFamilyName: string): Windows.Foundation.Collections.IIterable; - findPackagesForUser(userSecurityId: string, packageFamilyName: string): Windows.Foundation.Collections.IIterable; - findPackageForUser(userSecurityId: string, packageFullName: string): Windows.ApplicationModel.Package; - } - export class PackageManager implements Windows.Management.Deployment.IPackageManager { - addPackageAsync(packageUri: Windows.Foundation.Uri, dependencyPackageUris: Windows.Foundation.Collections.IIterable, deploymentOptions: Windows.Management.Deployment.DeploymentOptions): Windows.Foundation.IAsyncOperationWithProgress; - updatePackageAsync(packageUri: Windows.Foundation.Uri, dependencyPackageUris: Windows.Foundation.Collections.IIterable, deploymentOptions: Windows.Management.Deployment.DeploymentOptions): Windows.Foundation.IAsyncOperationWithProgress; - removePackageAsync(packageFullName: string): Windows.Foundation.IAsyncOperationWithProgress; - stagePackageAsync(packageUri: Windows.Foundation.Uri, dependencyPackageUris: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperationWithProgress; - registerPackageAsync(manifestUri: Windows.Foundation.Uri, dependencyPackageUris: Windows.Foundation.Collections.IIterable, deploymentOptions: Windows.Management.Deployment.DeploymentOptions): Windows.Foundation.IAsyncOperationWithProgress; - findPackages(): Windows.Foundation.Collections.IIterable; - findPackagesForUser(userSecurityId: string): Windows.Foundation.Collections.IIterable; - findPackages(packageName: string, packagePublisher: string): Windows.Foundation.Collections.IIterable; - findPackagesForUser(userSecurityId: string, packageName: string, packagePublisher: string): Windows.Foundation.Collections.IIterable; - findUsers(packageFullName: string): Windows.Foundation.Collections.IIterable; - setPackageState(packageFullName: string, packageState: Windows.Management.Deployment.PackageState): void; - findPackage(packageFullName: string): Windows.ApplicationModel.Package; - cleanupPackageForUserAsync(packageName: string, userSecurityId: string): Windows.Foundation.IAsyncOperationWithProgress; - findPackages(packageFamilyName: string): Windows.Foundation.Collections.IIterable; - findPackagesForUser(userSecurityId: string, packageFamilyName: string): Windows.Foundation.Collections.IIterable; - findPackageForUser(userSecurityId: string, packageFullName: string): Windows.ApplicationModel.Package; - } - } - } -} -declare module Windows { - export module Management { - export module Core { - export interface IApplicationDataManagerStatics { - createForPackageFamily(packageFamilyName: string): Windows.Storage.ApplicationData; - } - export interface IApplicationDataManager { - } - export class ApplicationDataManager implements Windows.Management.Core.IApplicationDataManager { - static createForPackageFamily(packageFamilyName: string): Windows.Storage.ApplicationData; - } - } - } -} -declare module Windows { - export module Media { - export module Capture { - export enum CameraCaptureUIMode { - photoOrVideo, - photo, - video, - } - export enum CameraCaptureUIPhotoFormat { - jpeg, - png, - jpegXR, - } - export enum CameraCaptureUIVideoFormat { - mp4, - wmv, - } - export enum CameraCaptureUIMaxVideoResolution { - highestAvailable, - lowDefinition, - standardDefinition, - highDefinition, - } - export enum CameraCaptureUIMaxPhotoResolution { - highestAvailable, - verySmallQvga, - smallVga, - mediumXga, - large3M, - veryLarge5M, - } - export interface ICameraCaptureUIPhotoCaptureSettings { - allowCropping: boolean; - croppedAspectRatio: Windows.Foundation.Size; - croppedSizeInPixels: Windows.Foundation.Size; - format: Windows.Media.Capture.CameraCaptureUIPhotoFormat; - maxResolution: Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution; - } - export class CameraCaptureUIPhotoCaptureSettings implements Windows.Media.Capture.ICameraCaptureUIPhotoCaptureSettings { - allowCropping: boolean; - croppedAspectRatio: Windows.Foundation.Size; - croppedSizeInPixels: Windows.Foundation.Size; - format: Windows.Media.Capture.CameraCaptureUIPhotoFormat; - maxResolution: Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution; - } - export interface ICameraCaptureUIVideoCaptureSettings { - allowTrimming: boolean; - format: Windows.Media.Capture.CameraCaptureUIVideoFormat; - maxDurationInSeconds: number; - maxResolution: Windows.Media.Capture.CameraCaptureUIMaxVideoResolution; - } - export class CameraCaptureUIVideoCaptureSettings implements Windows.Media.Capture.ICameraCaptureUIVideoCaptureSettings { - allowTrimming: boolean; - format: Windows.Media.Capture.CameraCaptureUIVideoFormat; - maxDurationInSeconds: number; - maxResolution: Windows.Media.Capture.CameraCaptureUIMaxVideoResolution; - } - export interface ICameraCaptureUI { - photoSettings: Windows.Media.Capture.CameraCaptureUIPhotoCaptureSettings; - videoSettings: Windows.Media.Capture.CameraCaptureUIVideoCaptureSettings; - captureFileAsync(mode: Windows.Media.Capture.CameraCaptureUIMode): Windows.Foundation.IAsyncOperation; - } - export class CameraCaptureUI implements Windows.Media.Capture.ICameraCaptureUI { - photoSettings: Windows.Media.Capture.CameraCaptureUIPhotoCaptureSettings; - videoSettings: Windows.Media.Capture.CameraCaptureUIVideoCaptureSettings; - captureFileAsync(mode: Windows.Media.Capture.CameraCaptureUIMode): Windows.Foundation.IAsyncOperation; - } - export interface ICameraOptionsUIStatics { - show(mediaCapture: Windows.Media.Capture.MediaCapture): void; - } - export class CameraOptionsUI { - static show(mediaCapture: Windows.Media.Capture.MediaCapture): void; - } - export enum MediaStreamType { - videoPreview, - videoRecord, - audio, - photo, - } - export enum StreamingCaptureMode { - audioAndVideo, - audio, - video, - } - export enum VideoRotation { - none, - clockwise90Degrees, - clockwise180Degrees, - clockwise270Degrees, - } - export enum PhotoCaptureSource { - auto, - videoPreview, - photo, - } - export enum VideoDeviceCharacteristic { - allStreamsIndependent, - previewRecordStreamsIdentical, - previewPhotoStreamsIdentical, - recordPhotoStreamsIdentical, - allStreamsIdentical, - } - export enum PowerlineFrequency { - disabled, - fiftyHertz, - sixtyHertz, - } - export interface IMediaCaptureFailedEventArgs { - code: number; - message: string; - } - export class MediaCaptureFailedEventArgs implements Windows.Media.Capture.IMediaCaptureFailedEventArgs { - code: number; - message: string; - } - export interface MediaCaptureFailedEventHandler { - (sender: Windows.Media.Capture.MediaCapture, errorEventArgs: Windows.Media.Capture.MediaCaptureFailedEventArgs): void; - } - export class MediaCapture implements Windows.Media.Capture.IMediaCapture, Windows.Media.Capture.IMediaCaptureVideoPreview { - audioDeviceController: Windows.Media.Devices.AudioDeviceController; - mediaCaptureSettings: Windows.Media.Capture.MediaCaptureSettings; - videoDeviceController: Windows.Media.Devices.VideoDeviceController; - initializeAsync(): Windows.Foundation.IAsyncAction; - initializeAsync(mediaCaptureInitializationSettings: Windows.Media.Capture.MediaCaptureInitializationSettings): Windows.Foundation.IAsyncAction; - startRecordToStorageFileAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - startRecordToStreamAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncAction; - startRecordToCustomSinkAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, customMediaSink: Windows.Media.IMediaExtension): Windows.Foundation.IAsyncAction; - startRecordToCustomSinkAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, customSinkActivationId: string, customSinkSettings: Windows.Foundation.Collections.IPropertySet): Windows.Foundation.IAsyncAction; - stopRecordAsync(): Windows.Foundation.IAsyncAction; - capturePhotoToStorageFileAsync(type: Windows.Media.MediaProperties.ImageEncodingProperties, file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - capturePhotoToStreamAsync(type: Windows.Media.MediaProperties.ImageEncodingProperties, stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncAction; - addEffectAsync(mediaStreamType: Windows.Media.Capture.MediaStreamType, effectActivationID: string, effectSettings: Windows.Foundation.Collections.IPropertySet): Windows.Foundation.IAsyncAction; - clearEffectsAsync(mediaStreamType: Windows.Media.Capture.MediaStreamType): Windows.Foundation.IAsyncAction; - setEncoderProperty(mediaStreamType: Windows.Media.Capture.MediaStreamType, propertyId: string, propertyValue: any): void; - getEncoderProperty(mediaStreamType: Windows.Media.Capture.MediaStreamType, propertyId: string): any; - onfailed: any/* TODO */; - onrecordlimitationexceeded: any/* TODO */; - setPreviewMirroring(value: boolean): void; - getPreviewMirroring(): boolean; - setPreviewRotation(value: Windows.Media.Capture.VideoRotation): void; - getPreviewRotation(): Windows.Media.Capture.VideoRotation; - setRecordRotation(value: Windows.Media.Capture.VideoRotation): void; - getRecordRotation(): Windows.Media.Capture.VideoRotation; - startPreviewAsync(): Windows.Foundation.IAsyncAction; - startPreviewToCustomSinkAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, customMediaSink: Windows.Media.IMediaExtension): Windows.Foundation.IAsyncAction; - startPreviewToCustomSinkAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, customSinkActivationId: string, customSinkSettings: Windows.Foundation.Collections.IPropertySet): Windows.Foundation.IAsyncAction; - stopPreviewAsync(): Windows.Foundation.IAsyncAction; - } - export interface RecordLimitationExceededEventHandler { - (sender: Windows.Media.Capture.MediaCapture): void; - } - export interface IMediaCaptureInitializationSettings { - audioDeviceId: string; - photoCaptureSource: Windows.Media.Capture.PhotoCaptureSource; - streamingCaptureMode: Windows.Media.Capture.StreamingCaptureMode; - videoDeviceId: string; - } - export class MediaCaptureInitializationSettings implements Windows.Media.Capture.IMediaCaptureInitializationSettings { - audioDeviceId: string; - photoCaptureSource: Windows.Media.Capture.PhotoCaptureSource; - streamingCaptureMode: Windows.Media.Capture.StreamingCaptureMode; - videoDeviceId: string; - } - export interface IMediaCapture { - audioDeviceController: Windows.Media.Devices.AudioDeviceController; - mediaCaptureSettings: Windows.Media.Capture.MediaCaptureSettings; - videoDeviceController: Windows.Media.Devices.VideoDeviceController; - initializeAsync(): Windows.Foundation.IAsyncAction; - initializeAsync(mediaCaptureInitializationSettings: Windows.Media.Capture.MediaCaptureInitializationSettings): Windows.Foundation.IAsyncAction; - startRecordToStorageFileAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - startRecordToStreamAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncAction; - startRecordToCustomSinkAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, customMediaSink: Windows.Media.IMediaExtension): Windows.Foundation.IAsyncAction; - startRecordToCustomSinkAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, customSinkActivationId: string, customSinkSettings: Windows.Foundation.Collections.IPropertySet): Windows.Foundation.IAsyncAction; - stopRecordAsync(): Windows.Foundation.IAsyncAction; - capturePhotoToStorageFileAsync(type: Windows.Media.MediaProperties.ImageEncodingProperties, file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - capturePhotoToStreamAsync(type: Windows.Media.MediaProperties.ImageEncodingProperties, stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncAction; - addEffectAsync(mediaStreamType: Windows.Media.Capture.MediaStreamType, effectActivationID: string, effectSettings: Windows.Foundation.Collections.IPropertySet): Windows.Foundation.IAsyncAction; - clearEffectsAsync(mediaStreamType: Windows.Media.Capture.MediaStreamType): Windows.Foundation.IAsyncAction; - setEncoderProperty(mediaStreamType: Windows.Media.Capture.MediaStreamType, propertyId: string, propertyValue: any): void; - getEncoderProperty(mediaStreamType: Windows.Media.Capture.MediaStreamType, propertyId: string): any; - onfailed: any/* TODO */; - onrecordlimitationexceeded: any/* TODO */; - setPreviewMirroring(value: boolean): void; - getPreviewMirroring(): boolean; - setPreviewRotation(value: Windows.Media.Capture.VideoRotation): void; - getPreviewRotation(): Windows.Media.Capture.VideoRotation; - setRecordRotation(value: Windows.Media.Capture.VideoRotation): void; - getRecordRotation(): Windows.Media.Capture.VideoRotation; - } - export class MediaCaptureSettings implements Windows.Media.Capture.IMediaCaptureSettings { - audioDeviceId: string; - photoCaptureSource: Windows.Media.Capture.PhotoCaptureSource; - streamingCaptureMode: Windows.Media.Capture.StreamingCaptureMode; - videoDeviceCharacteristic: Windows.Media.Capture.VideoDeviceCharacteristic; - videoDeviceId: string; - } - export interface IMediaCaptureVideoPreview { - startPreviewAsync(): Windows.Foundation.IAsyncAction; - startPreviewToCustomSinkAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, customMediaSink: Windows.Media.IMediaExtension): Windows.Foundation.IAsyncAction; - startPreviewToCustomSinkAsync(encodingProfile: Windows.Media.MediaProperties.MediaEncodingProfile, customSinkActivationId: string, customSinkSettings: Windows.Foundation.Collections.IPropertySet): Windows.Foundation.IAsyncAction; - stopPreviewAsync(): Windows.Foundation.IAsyncAction; - } - export interface IMediaCaptureSettings { - audioDeviceId: string; - photoCaptureSource: Windows.Media.Capture.PhotoCaptureSource; - streamingCaptureMode: Windows.Media.Capture.StreamingCaptureMode; - videoDeviceCharacteristic: Windows.Media.Capture.VideoDeviceCharacteristic; - videoDeviceId: string; - } - } - } -} -declare module Windows { - export module Media { - export module Devices { - export enum TelephonyKey { - d0, - d1, - d2, - d3, - d4, - d5, - d6, - d7, - d8, - d9, - star, - pound, - a, - b, - c, - d, - } - export interface IDialRequestedEventArgs { - contact: any; - handled(): void; - } - export class DialRequestedEventArgs implements Windows.Media.Devices.IDialRequestedEventArgs { - contact: any; - handled(): void; - } - export interface IRedialRequestedEventArgs { - handled(): void; - } - export class RedialRequestedEventArgs implements Windows.Media.Devices.IRedialRequestedEventArgs { - handled(): void; - } - export interface IKeypadPressedEventArgs { - telephonyKey: Windows.Media.Devices.TelephonyKey; - } - export class KeypadPressedEventArgs implements Windows.Media.Devices.IKeypadPressedEventArgs { - telephonyKey: Windows.Media.Devices.TelephonyKey; - } - export interface CallControlEventHandler { - (sender: Windows.Media.Devices.CallControl): void; - } - export class CallControl implements Windows.Media.Devices.ICallControl { - hasRinger: boolean; - indicateNewIncomingCall(enableRinger: boolean, callerId: string): number; - indicateNewOutgoingCall(): number; - indicateActiveCall(callToken: number): void; - endCall(callToken: number): void; - onanswerrequested: any/* TODO */; - onhanguprequested: any/* TODO */; - ondialrequested: any/* TODO */; - onredialrequested: any/* TODO */; - onkeypadpressed: any/* TODO */; - onaudiotransferrequested: any/* TODO */; - static getDefault(): Windows.Media.Devices.CallControl; - static fromId(deviceInterfaceId: string): Windows.Media.Devices.CallControl; - } - export interface DialRequestedEventHandler { - (sender: Windows.Media.Devices.CallControl, e: Windows.Media.Devices.DialRequestedEventArgs): void; - } - export interface RedialRequestedEventHandler { - (sender: Windows.Media.Devices.CallControl, e: Windows.Media.Devices.RedialRequestedEventArgs): void; - } - export interface KeypadPressedEventHandler { - (sender: Windows.Media.Devices.CallControl, e: Windows.Media.Devices.KeypadPressedEventArgs): void; - } - export interface ICallControl { - hasRinger: boolean; - indicateNewIncomingCall(enableRinger: boolean, callerId: string): number; - indicateNewOutgoingCall(): number; - indicateActiveCall(callToken: number): void; - endCall(callToken: number): void; - onanswerrequested: any/* TODO */; - onhanguprequested: any/* TODO */; - ondialrequested: any/* TODO */; - onredialrequested: any/* TODO */; - onkeypadpressed: any/* TODO */; - onaudiotransferrequested: any/* TODO */; - } - export interface ICallControlStatics { - getDefault(): Windows.Media.Devices.CallControl; - fromId(deviceInterfaceId: string): Windows.Media.Devices.CallControl; - } - export enum AudioDeviceRole { - default, - communications, - } - export interface IDefaultAudioDeviceChangedEventArgs { - id: string; - role: Windows.Media.Devices.AudioDeviceRole; - } - export interface IMediaDeviceStatics { - getAudioCaptureSelector(): string; - getAudioRenderSelector(): string; - getVideoCaptureSelector(): string; - getDefaultAudioCaptureId(role: Windows.Media.Devices.AudioDeviceRole): string; - getDefaultAudioRenderId(role: Windows.Media.Devices.AudioDeviceRole): string; - ondefaultaudiocapturedevicechanged: any/* TODO */; - ondefaultaudiorenderdevicechanged: any/* TODO */; - } - export class DefaultAudioCaptureDeviceChangedEventArgs implements Windows.Media.Devices.IDefaultAudioDeviceChangedEventArgs { - id: string; - role: Windows.Media.Devices.AudioDeviceRole; - } - export class DefaultAudioRenderDeviceChangedEventArgs implements Windows.Media.Devices.IDefaultAudioDeviceChangedEventArgs { - id: string; - role: Windows.Media.Devices.AudioDeviceRole; - } - export class MediaDevice { - static getAudioCaptureSelector(): string; - static getAudioRenderSelector(): string; - static getVideoCaptureSelector(): string; - static getDefaultAudioCaptureId(role: Windows.Media.Devices.AudioDeviceRole): string; - static getDefaultAudioRenderId(role: Windows.Media.Devices.AudioDeviceRole): string; - static ondefaultaudiocapturedevicechanged: any/* TODO */; - static ondefaultaudiorenderdevicechanged: any/* TODO */; - } - export class AudioDeviceController implements Windows.Media.Devices.IAudioDeviceController, Windows.Media.Devices.IMediaDeviceController { - muted: boolean; - volumePercent: number; - getAvailableMediaStreamProperties(mediaStreamType: Windows.Media.Capture.MediaStreamType): Windows.Foundation.Collections.IVectorView; - getMediaStreamProperties(mediaStreamType: Windows.Media.Capture.MediaStreamType): Windows.Media.MediaProperties.IMediaEncodingProperties; - setMediaStreamPropertiesAsync(mediaStreamType: Windows.Media.Capture.MediaStreamType, mediaEncodingProperties: Windows.Media.MediaProperties.IMediaEncodingProperties): Windows.Foundation.IAsyncAction; - } - export class VideoDeviceController implements Windows.Media.Devices.IVideoDeviceController, Windows.Media.Devices.IMediaDeviceController, Windows.Media.Devices.IAdvancedVideoCaptureDeviceController { - backlightCompensation: Windows.Media.Devices.MediaDeviceControl; - brightness: Windows.Media.Devices.MediaDeviceControl; - contrast: Windows.Media.Devices.MediaDeviceControl; - exposure: Windows.Media.Devices.MediaDeviceControl; - focus: Windows.Media.Devices.MediaDeviceControl; - hue: Windows.Media.Devices.MediaDeviceControl; - pan: Windows.Media.Devices.MediaDeviceControl; - roll: Windows.Media.Devices.MediaDeviceControl; - tilt: Windows.Media.Devices.MediaDeviceControl; - whiteBalance: Windows.Media.Devices.MediaDeviceControl; - zoom: Windows.Media.Devices.MediaDeviceControl; - trySetPowerlineFrequency(value: Windows.Media.Capture.PowerlineFrequency): boolean; - tryGetPowerlineFrequency(): { value: Windows.Media.Capture.PowerlineFrequency; succeeded: boolean; }; - getAvailableMediaStreamProperties(mediaStreamType: Windows.Media.Capture.MediaStreamType): Windows.Foundation.Collections.IVectorView; - getMediaStreamProperties(mediaStreamType: Windows.Media.Capture.MediaStreamType): Windows.Media.MediaProperties.IMediaEncodingProperties; - setMediaStreamPropertiesAsync(mediaStreamType: Windows.Media.Capture.MediaStreamType, mediaEncodingProperties: Windows.Media.MediaProperties.IMediaEncodingProperties): Windows.Foundation.IAsyncAction; - setDeviceProperty(propertyId: string, propertyValue: any): void; - getDeviceProperty(propertyId: string): any; - } - export interface IMediaDeviceController { - getAvailableMediaStreamProperties(mediaStreamType: Windows.Media.Capture.MediaStreamType): Windows.Foundation.Collections.IVectorView; - getMediaStreamProperties(mediaStreamType: Windows.Media.Capture.MediaStreamType): Windows.Media.MediaProperties.IMediaEncodingProperties; - setMediaStreamPropertiesAsync(mediaStreamType: Windows.Media.Capture.MediaStreamType, mediaEncodingProperties: Windows.Media.MediaProperties.IMediaEncodingProperties): Windows.Foundation.IAsyncAction; - } - export interface IAudioDeviceController extends Windows.Media.Devices.IMediaDeviceController { - muted: boolean; - volumePercent: number; - } - export interface IVideoDeviceController extends Windows.Media.Devices.IMediaDeviceController { - backlightCompensation: Windows.Media.Devices.MediaDeviceControl; - brightness: Windows.Media.Devices.MediaDeviceControl; - contrast: Windows.Media.Devices.MediaDeviceControl; - exposure: Windows.Media.Devices.MediaDeviceControl; - focus: Windows.Media.Devices.MediaDeviceControl; - hue: Windows.Media.Devices.MediaDeviceControl; - pan: Windows.Media.Devices.MediaDeviceControl; - roll: Windows.Media.Devices.MediaDeviceControl; - tilt: Windows.Media.Devices.MediaDeviceControl; - whiteBalance: Windows.Media.Devices.MediaDeviceControl; - zoom: Windows.Media.Devices.MediaDeviceControl; - trySetPowerlineFrequency(value: Windows.Media.Capture.PowerlineFrequency): boolean; - tryGetPowerlineFrequency(): { value: Windows.Media.Capture.PowerlineFrequency; succeeded: boolean; }; - } - export class MediaDeviceControl implements Windows.Media.Devices.IMediaDeviceControl { - capabilities: Windows.Media.Devices.MediaDeviceControlCapabilities; - tryGetValue(): { value: number; succeeded: boolean; }; - trySetValue(value: number): boolean; - tryGetAuto(): { value: boolean; succeeded: boolean; }; - trySetAuto(value: boolean): boolean; - } - export interface IMediaDeviceControl { - capabilities: Windows.Media.Devices.MediaDeviceControlCapabilities; - tryGetValue(): { value: number; succeeded: boolean; }; - trySetValue(value: number): boolean; - tryGetAuto(): { value: boolean; succeeded: boolean; }; - trySetAuto(value: boolean): boolean; - } - export class MediaDeviceControlCapabilities implements Windows.Media.Devices.IMediaDeviceControlCapabilities { - autoModeSupported: boolean; - default: number; - max: number; - min: number; - step: number; - supported: boolean; - } - export interface IMediaDeviceControlCapabilities { - autoModeSupported: boolean; - default: number; - max: number; - min: number; - step: number; - supported: boolean; - } - export interface IAdvancedVideoCaptureDeviceController { - setDeviceProperty(propertyId: string, propertyValue: any): void; - getDeviceProperty(propertyId: string): any; - } - } - } -} -declare module Windows { - export module Media { - export enum SoundLevel { - muted, - low, - full, - } - export interface IMediaControl { - albumArt: Windows.Foundation.Uri; - artistName: string; - isPlaying: boolean; - soundLevel: Windows.Media.SoundLevel; - trackName: string; - onsoundlevelchanged: any/* TODO */; - onplaypressed: any/* TODO */; - onpausepressed: any/* TODO */; - onstoppressed: any/* TODO */; - onplaypausetogglepressed: any/* TODO */; - onrecordpressed: any/* TODO */; - onnexttrackpressed: any/* TODO */; - onprevioustrackpressed: any/* TODO */; - onfastforwardpressed: any/* TODO */; - onrewindpressed: any/* TODO */; - onchanneluppressed: any/* TODO */; - onchanneldownpressed: any/* TODO */; - } - export class MediaControl { - static albumArt: Windows.Foundation.Uri; - static artistName: string; - static isPlaying: boolean; - static soundLevel: Windows.Media.SoundLevel; - static trackName: string; - static onsoundlevelchanged: any/* TODO */; - static onplaypressed: any/* TODO */; - static onpausepressed: any/* TODO */; - static onstoppressed: any/* TODO */; - static onplaypausetogglepressed: any/* TODO */; - static onrecordpressed: any/* TODO */; - static onnexttrackpressed: any/* TODO */; - static onprevioustrackpressed: any/* TODO */; - static onfastforwardpressed: any/* TODO */; - static onrewindpressed: any/* TODO */; - static onchanneluppressed: any/* TODO */; - static onchanneldownpressed: any/* TODO */; - } - export interface IMediaExtension { - setProperties(configuration: Windows.Foundation.Collections.IPropertySet): void; - } - export interface IMediaExtensionManager { - registerSchemeHandler(activatableClassId: string, scheme: string): void; - registerSchemeHandler(activatableClassId: string, scheme: string, configuration: Windows.Foundation.Collections.IPropertySet): void; - registerByteStreamHandler(activatableClassId: string, fileExtension: string, mimeType: string): void; - registerByteStreamHandler(activatableClassId: string, fileExtension: string, mimeType: string, configuration: Windows.Foundation.Collections.IPropertySet): void; - registerAudioDecoder(activatableClassId: string, inputSubtype: string, outputSubtype: string): void; - registerAudioDecoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.IPropertySet): void; - registerAudioEncoder(activatableClassId: string, inputSubtype: string, outputSubtype: string): void; - registerAudioEncoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.IPropertySet): void; - registerVideoDecoder(activatableClassId: string, inputSubtype: string, outputSubtype: string): void; - registerVideoDecoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.IPropertySet): void; - registerVideoEncoder(activatableClassId: string, inputSubtype: string, outputSubtype: string): void; - registerVideoEncoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.IPropertySet): void; - } - export class MediaExtensionManager implements Windows.Media.IMediaExtensionManager { - registerSchemeHandler(activatableClassId: string, scheme: string): void; - registerSchemeHandler(activatableClassId: string, scheme: string, configuration: Windows.Foundation.Collections.IPropertySet): void; - registerByteStreamHandler(activatableClassId: string, fileExtension: string, mimeType: string): void; - registerByteStreamHandler(activatableClassId: string, fileExtension: string, mimeType: string, configuration: Windows.Foundation.Collections.IPropertySet): void; - registerAudioDecoder(activatableClassId: string, inputSubtype: string, outputSubtype: string): void; - registerAudioDecoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.IPropertySet): void; - registerAudioEncoder(activatableClassId: string, inputSubtype: string, outputSubtype: string): void; - registerAudioEncoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.IPropertySet): void; - registerVideoDecoder(activatableClassId: string, inputSubtype: string, outputSubtype: string): void; - registerVideoDecoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.IPropertySet): void; - registerVideoEncoder(activatableClassId: string, inputSubtype: string, outputSubtype: string): void; - registerVideoEncoder(activatableClassId: string, inputSubtype: string, outputSubtype: string, configuration: Windows.Foundation.Collections.IPropertySet): void; - } - export interface IVideoEffectsStatics { - videoStabilization: string; - } - export class VideoEffects { - static videoStabilization: string; - } - } -} -declare module Windows { - export module Media { - export module Playlists { - export enum PlaylistFormat { - windowsMedia, - zune, - m3u, - } - export interface IPlaylist { - files: Windows.Foundation.Collections.IVector; - saveAsync(): Windows.Foundation.IAsyncAction; - saveAsAsync(saveLocation: Windows.Storage.IStorageFolder, desiredName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncOperation; - saveAsAsync(saveLocation: Windows.Storage.IStorageFolder, desiredName: string, option: Windows.Storage.NameCollisionOption, playlistFormat: Windows.Media.Playlists.PlaylistFormat): Windows.Foundation.IAsyncOperation; - } - export interface IPlaylistStatics { - loadAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - } - export class Playlist implements Windows.Media.Playlists.IPlaylist { - files: Windows.Foundation.Collections.IVector; - saveAsync(): Windows.Foundation.IAsyncAction; - saveAsAsync(saveLocation: Windows.Storage.IStorageFolder, desiredName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncOperation; - saveAsAsync(saveLocation: Windows.Storage.IStorageFolder, desiredName: string, option: Windows.Storage.NameCollisionOption, playlistFormat: Windows.Media.Playlists.PlaylistFormat): Windows.Foundation.IAsyncOperation; - static loadAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - } - } - } -} -declare module Windows { - export module Media { - export module PlayTo { - export interface IPlayToSource { - connection: Windows.Media.PlayTo.PlayToConnection; - next: Windows.Media.PlayTo.PlayToSource; - playNext(): void; - } - export class PlayToConnection implements Windows.Media.PlayTo.IPlayToConnection { - state: Windows.Media.PlayTo.PlayToConnectionState; - onstatechanged: any/* TODO */; - ontransferred: any/* TODO */; - onerror: any/* TODO */; - } - export class PlayToSource implements Windows.Media.PlayTo.IPlayToSource { - connection: Windows.Media.PlayTo.PlayToConnection; - next: Windows.Media.PlayTo.PlayToSource; - playNext(): void; - } - export enum PlayToConnectionState { - disconnected, - connected, - rendering, - } - export interface IPlayToConnectionStateChangedEventArgs { - currentState: Windows.Media.PlayTo.PlayToConnectionState; - previousState: Windows.Media.PlayTo.PlayToConnectionState; - } - export class PlayToConnectionStateChangedEventArgs implements Windows.Media.PlayTo.IPlayToConnectionStateChangedEventArgs { - currentState: Windows.Media.PlayTo.PlayToConnectionState; - previousState: Windows.Media.PlayTo.PlayToConnectionState; - } - export interface IPlayToConnectionTransferredEventArgs { - currentSource: Windows.Media.PlayTo.PlayToSource; - previousSource: Windows.Media.PlayTo.PlayToSource; - } - export class PlayToConnectionTransferredEventArgs implements Windows.Media.PlayTo.IPlayToConnectionTransferredEventArgs { - currentSource: Windows.Media.PlayTo.PlayToSource; - previousSource: Windows.Media.PlayTo.PlayToSource; - } - export enum PlayToConnectionError { - none, - deviceNotResponding, - deviceError, - deviceLocked, - } - export interface IPlayToConnectionErrorEventArgs { - code: Windows.Media.PlayTo.PlayToConnectionError; - message: string; - } - export class PlayToConnectionErrorEventArgs implements Windows.Media.PlayTo.IPlayToConnectionErrorEventArgs { - code: Windows.Media.PlayTo.PlayToConnectionError; - message: string; - } - export interface IPlayToConnection { - state: Windows.Media.PlayTo.PlayToConnectionState; - onstatechanged: any/* TODO */; - ontransferred: any/* TODO */; - onerror: any/* TODO */; - } - export interface ISourceChangeRequestedEventArgs { - album: string; - author: string; - date: Date; - description: string; - genre: string; - properties: Windows.Foundation.Collections.IMapView; - rating: number; - stream: Windows.Storage.Streams.IRandomAccessStreamWithContentType; - thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; - title: string; - } - export class SourceChangeRequestedEventArgs implements Windows.Media.PlayTo.ISourceChangeRequestedEventArgs { - album: string; - author: string; - date: Date; - description: string; - genre: string; - properties: Windows.Foundation.Collections.IMapView; - rating: number; - stream: Windows.Storage.Streams.IRandomAccessStreamWithContentType; - thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference; - title: string; - } - export interface IPlaybackRateChangeRequestedEventArgs { - rate: number; - } - export class PlaybackRateChangeRequestedEventArgs implements Windows.Media.PlayTo.IPlaybackRateChangeRequestedEventArgs { - rate: number; - } - export interface ICurrentTimeChangeRequestedEventArgs { - time: number; - } - export class CurrentTimeChangeRequestedEventArgs implements Windows.Media.PlayTo.ICurrentTimeChangeRequestedEventArgs { - time: number; - } - export interface IMuteChangeRequestedEventArgs { - mute: boolean; - } - export class MuteChangeRequestedEventArgs implements Windows.Media.PlayTo.IMuteChangeRequestedEventArgs { - mute: boolean; - } - export interface IVolumeChangeRequestedEventArgs { - volume: number; - } - export class VolumeChangeRequestedEventArgs implements Windows.Media.PlayTo.IVolumeChangeRequestedEventArgs { - volume: number; - } - export interface IPlayToReceiver { - friendlyName: string; - properties: Windows.Foundation.Collections.IPropertySet; - supportsAudio: boolean; - supportsImage: boolean; - supportsVideo: boolean; - onplayrequested: any/* TODO */; - onpauserequested: any/* TODO */; - onsourcechangerequested: any/* TODO */; - onplaybackratechangerequested: any/* TODO */; - oncurrenttimechangerequested: any/* TODO */; - onmutechangerequested: any/* TODO */; - onvolumechangerequested: any/* TODO */; - ontimeupdaterequested: any/* TODO */; - onstoprequested: any/* TODO */; - notifyVolumeChange(volume: number, mute: boolean): void; - notifyRateChange(rate: number): void; - notifyLoadedMetadata(): void; - notifyTimeUpdate(currentTime: number): void; - notifyDurationChange(duration: number): void; - notifySeeking(): void; - notifySeeked(): void; - notifyPaused(): void; - notifyPlaying(): void; - notifyEnded(): void; - notifyError(): void; - notifyStopped(): void; - startAsync(): Windows.Foundation.IAsyncAction; - stopAsync(): Windows.Foundation.IAsyncAction; - } - export class PlayToReceiver implements Windows.Media.PlayTo.IPlayToReceiver { - friendlyName: string; - properties: Windows.Foundation.Collections.IPropertySet; - supportsAudio: boolean; - supportsImage: boolean; - supportsVideo: boolean; - onplayrequested: any/* TODO */; - onpauserequested: any/* TODO */; - onsourcechangerequested: any/* TODO */; - onplaybackratechangerequested: any/* TODO */; - oncurrenttimechangerequested: any/* TODO */; - onmutechangerequested: any/* TODO */; - onvolumechangerequested: any/* TODO */; - ontimeupdaterequested: any/* TODO */; - onstoprequested: any/* TODO */; - notifyVolumeChange(volume: number, mute: boolean): void; - notifyRateChange(rate: number): void; - notifyLoadedMetadata(): void; - notifyTimeUpdate(currentTime: number): void; - notifyDurationChange(duration: number): void; - notifySeeking(): void; - notifySeeked(): void; - notifyPaused(): void; - notifyPlaying(): void; - notifyEnded(): void; - notifyError(): void; - notifyStopped(): void; - startAsync(): Windows.Foundation.IAsyncAction; - stopAsync(): Windows.Foundation.IAsyncAction; - } - export interface IPlayToSourceSelectedEventArgs { - friendlyName: string; - icon: Windows.Storage.Streams.IRandomAccessStreamWithContentType; - supportsAudio: boolean; - supportsImage: boolean; - supportsVideo: boolean; - } - export class PlayToSourceSelectedEventArgs implements Windows.Media.PlayTo.IPlayToSourceSelectedEventArgs { - friendlyName: string; - icon: Windows.Storage.Streams.IRandomAccessStreamWithContentType; - supportsAudio: boolean; - supportsImage: boolean; - supportsVideo: boolean; - } - export interface IPlayToSourceDeferral { - complete(): void; - } - export class PlayToSourceDeferral implements Windows.Media.PlayTo.IPlayToSourceDeferral { - complete(): void; - } - export interface IPlayToSourceRequest { - deadline: Date; - displayErrorString(errorString: string): void; - getDeferral(): Windows.Media.PlayTo.PlayToSourceDeferral; - setSource(value: Windows.Media.PlayTo.PlayToSource): void; - } - export class PlayToSourceRequest implements Windows.Media.PlayTo.IPlayToSourceRequest { - deadline: Date; - displayErrorString(errorString: string): void; - getDeferral(): Windows.Media.PlayTo.PlayToSourceDeferral; - setSource(value: Windows.Media.PlayTo.PlayToSource): void; - } - export interface IPlayToSourceRequestedEventArgs { - sourceRequest: Windows.Media.PlayTo.PlayToSourceRequest; - } - export class PlayToSourceRequestedEventArgs implements Windows.Media.PlayTo.IPlayToSourceRequestedEventArgs { - sourceRequest: Windows.Media.PlayTo.PlayToSourceRequest; - } - export interface IPlayToManager { - defaultSourceSelection: boolean; - onsourcerequested: any/* TODO */; - onsourceselected: any/* TODO */; - } - export class PlayToManager implements Windows.Media.PlayTo.IPlayToManager { - defaultSourceSelection: boolean; - onsourcerequested: any/* TODO */; - onsourceselected: any/* TODO */; - static getForCurrentView(): Windows.Media.PlayTo.PlayToManager; - static showPlayToUI(): void; - } - export interface IPlayToManagerStatics { - getForCurrentView(): Windows.Media.PlayTo.PlayToManager; - showPlayToUI(): void; - } - } - } -} -declare module Windows { - export module Media { - export module MediaProperties { - export interface IMediaRatio { - denominator: number; - numerator: number; - } - export class MediaRatio implements Windows.Media.MediaProperties.IMediaRatio { - denominator: number; - numerator: number; - } - export class MediaPropertySet implements Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { - size: number; - lookup(key: string): any; - hasKey(key: string): boolean; - getView(): Windows.Foundation.Collections.IMapView; - insert(key: string, value: any): boolean; - remove(key: string): void; - clear(): void; - first(): Windows.Foundation.Collections.IIterator>; - } - export interface IMediaEncodingProperties { - properties: Windows.Media.MediaProperties.MediaPropertySet; - subtype: string; - type: string; - } - export interface IAudioEncodingProperties extends Windows.Media.MediaProperties.IMediaEncodingProperties { - bitrate: number; - bitsPerSample: number; - channelCount: number; - sampleRate: number; - } - export class AudioEncodingProperties implements Windows.Media.MediaProperties.IAudioEncodingProperties, Windows.Media.MediaProperties.IMediaEncodingProperties { - bitrate: number; - bitsPerSample: number; - channelCount: number; - sampleRate: number; - properties: Windows.Media.MediaProperties.MediaPropertySet; - subtype: string; - type: string; - } - export interface IVideoEncodingProperties extends Windows.Media.MediaProperties.IMediaEncodingProperties { - bitrate: number; - frameRate: Windows.Media.MediaProperties.MediaRatio; - height: number; - pixelAspectRatio: Windows.Media.MediaProperties.MediaRatio; - width: number; - } - export class VideoEncodingProperties implements Windows.Media.MediaProperties.IVideoEncodingProperties, Windows.Media.MediaProperties.IMediaEncodingProperties { - bitrate: number; - frameRate: Windows.Media.MediaProperties.MediaRatio; - height: number; - pixelAspectRatio: Windows.Media.MediaProperties.MediaRatio; - width: number; - properties: Windows.Media.MediaProperties.MediaPropertySet; - subtype: string; - type: string; - } - export interface IImageEncodingProperties extends Windows.Media.MediaProperties.IMediaEncodingProperties { - height: number; - width: number; - } - export interface IImageEncodingPropertiesStatics { - createJpeg(): Windows.Media.MediaProperties.ImageEncodingProperties; - createPng(): Windows.Media.MediaProperties.ImageEncodingProperties; - createJpegXR(): Windows.Media.MediaProperties.ImageEncodingProperties; - } - export class ImageEncodingProperties implements Windows.Media.MediaProperties.IImageEncodingProperties, Windows.Media.MediaProperties.IMediaEncodingProperties { - height: number; - width: number; - properties: Windows.Media.MediaProperties.MediaPropertySet; - subtype: string; - type: string; - static createJpeg(): Windows.Media.MediaProperties.ImageEncodingProperties; - static createPng(): Windows.Media.MediaProperties.ImageEncodingProperties; - static createJpegXR(): Windows.Media.MediaProperties.ImageEncodingProperties; - } - export interface IContainerEncodingProperties extends Windows.Media.MediaProperties.IMediaEncodingProperties { - } - export class ContainerEncodingProperties implements Windows.Media.MediaProperties.IContainerEncodingProperties, Windows.Media.MediaProperties.IMediaEncodingProperties { - properties: Windows.Media.MediaProperties.MediaPropertySet; - subtype: string; - type: string; - } - export enum AudioEncodingQuality { - auto, - high, - medium, - low, - } - export enum VideoEncodingQuality { - auto, - hD1080p, - hD720p, - wvga, - ntsc, - pal, - vga, - qvga, - } - export interface IMediaEncodingProfileStatics { - createM4a(quality: Windows.Media.MediaProperties.AudioEncodingQuality): Windows.Media.MediaProperties.MediaEncodingProfile; - createMp3(quality: Windows.Media.MediaProperties.AudioEncodingQuality): Windows.Media.MediaProperties.MediaEncodingProfile; - createWma(quality: Windows.Media.MediaProperties.AudioEncodingQuality): Windows.Media.MediaProperties.MediaEncodingProfile; - createMp4(quality: Windows.Media.MediaProperties.VideoEncodingQuality): Windows.Media.MediaProperties.MediaEncodingProfile; - createWmv(quality: Windows.Media.MediaProperties.VideoEncodingQuality): Windows.Media.MediaProperties.MediaEncodingProfile; - createFromFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - createFromStreamAsync(stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncOperation; - } - export class MediaEncodingProfile implements Windows.Media.MediaProperties.IMediaEncodingProfile { - audio: Windows.Media.MediaProperties.AudioEncodingProperties; - container: Windows.Media.MediaProperties.ContainerEncodingProperties; - video: Windows.Media.MediaProperties.VideoEncodingProperties; - static createM4a(quality: Windows.Media.MediaProperties.AudioEncodingQuality): Windows.Media.MediaProperties.MediaEncodingProfile; - static createMp3(quality: Windows.Media.MediaProperties.AudioEncodingQuality): Windows.Media.MediaProperties.MediaEncodingProfile; - static createWma(quality: Windows.Media.MediaProperties.AudioEncodingQuality): Windows.Media.MediaProperties.MediaEncodingProfile; - static createMp4(quality: Windows.Media.MediaProperties.VideoEncodingQuality): Windows.Media.MediaProperties.MediaEncodingProfile; - static createWmv(quality: Windows.Media.MediaProperties.VideoEncodingQuality): Windows.Media.MediaProperties.MediaEncodingProfile; - static createFromFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - static createFromStreamAsync(stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncOperation; - } - export interface IMediaEncodingProfile { - audio: Windows.Media.MediaProperties.AudioEncodingProperties; - container: Windows.Media.MediaProperties.ContainerEncodingProperties; - video: Windows.Media.MediaProperties.VideoEncodingProperties; - } - } - } -} -declare module Windows { - export module Media { - export module Protection { - export class MediaProtectionManager implements Windows.Media.Protection.IMediaProtectionManager { - properties: Windows.Foundation.Collections.IPropertySet; - onservicerequested: any/* TODO */; - onrebootneeded: any/* TODO */; - oncomponentloadfailed: any/* TODO */; - } - export class ServiceRequestedEventArgs implements Windows.Media.Protection.IServiceRequestedEventArgs { - completion: Windows.Media.Protection.MediaProtectionServiceCompletion; - request: Windows.Media.Protection.IMediaProtectionServiceRequest; - } - export class ComponentLoadFailedEventArgs implements Windows.Media.Protection.IComponentLoadFailedEventArgs { - completion: Windows.Media.Protection.MediaProtectionServiceCompletion; - information: Windows.Media.Protection.RevocationAndRenewalInformation; - } - export class MediaProtectionServiceCompletion implements Windows.Media.Protection.IMediaProtectionServiceCompletion { - complete(success: boolean): void; - } - export class RevocationAndRenewalInformation implements Windows.Media.Protection.IRevocationAndRenewalInformation { - items: Windows.Foundation.Collections.IVector; - } - export class RevocationAndRenewalItem implements Windows.Media.Protection.IRevocationAndRenewalItem { - headerHash: string; - name: string; - publicKeyHash: string; - reasons: Windows.Media.Protection.RevocationAndRenewalReasons; - renewalId: string; - } - export interface ServiceRequestedEventHandler { - (sender: Windows.Media.Protection.MediaProtectionManager, e: Windows.Media.Protection.ServiceRequestedEventArgs): void; - } - export interface RebootNeededEventHandler { - (sender: Windows.Media.Protection.MediaProtectionManager): void; - } - export interface ComponentLoadFailedEventHandler { - (sender: Windows.Media.Protection.MediaProtectionManager, e: Windows.Media.Protection.ComponentLoadFailedEventArgs): void; - } - export interface IMediaProtectionManager { - properties: Windows.Foundation.Collections.IPropertySet; - onservicerequested: any/* TODO */; - onrebootneeded: any/* TODO */; - oncomponentloadfailed: any/* TODO */; - } - export interface IMediaProtectionServiceCompletion { - complete(success: boolean): void; - } - export interface IServiceRequestedEventArgs { - completion: Windows.Media.Protection.MediaProtectionServiceCompletion; - request: Windows.Media.Protection.IMediaProtectionServiceRequest; - } - export interface IMediaProtectionServiceRequest { - protectionSystem: string; - type: string; - } - export interface IComponentLoadFailedEventArgs { - completion: Windows.Media.Protection.MediaProtectionServiceCompletion; - information: Windows.Media.Protection.RevocationAndRenewalInformation; - } - export interface IRevocationAndRenewalInformation { - items: Windows.Foundation.Collections.IVector; - } - export enum RevocationAndRenewalReasons { - userModeComponentLoad, - kernelModeComponentLoad, - appComponent, - globalRevocationListLoadFailed, - invalidGlobalRevocationListSignature, - globalRevocationListAbsent, - componentRevoked, - invalidComponentCertificateExtendedKeyUse, - componentCertificateRevoked, - invalidComponentCertificateRoot, - componentHighSecurityCertificateRevoked, - componentLowSecurityCertificateRevoked, - bootDriverVerificationFailed, - componentSignedWithTestCertificate, - encryptionFailure, - } - export interface IRevocationAndRenewalItem { - headerHash: string; - name: string; - publicKeyHash: string; - reasons: Windows.Media.Protection.RevocationAndRenewalReasons; - renewalId: string; - } - export class ComponentRenewal { - static renewSystemComponentsAsync(information: Windows.Media.Protection.RevocationAndRenewalInformation): Windows.Foundation.IAsyncOperationWithProgress; - } - export enum RenewalStatus { - notStarted, - updatesInProgress, - userCancelled, - appComponentsMayNeedUpdating, - noComponentsFound, - } - export interface IComponentRenewalStatics { - renewSystemComponentsAsync(information: Windows.Media.Protection.RevocationAndRenewalInformation): Windows.Foundation.IAsyncOperationWithProgress; - } - } - } -} -declare module Windows { - export module Media { - export module Transcoding { - export enum TranscodeFailureReason { - none, - unknown, - invalidProfile, - codecNotFound, - } - export interface IMediaTranscoder { - alwaysReencode: boolean; - hardwareAccelerationEnabled: boolean; - trimStartTime: number; - trimStopTime: number; - addAudioEffect(activatableClassId: string): void; - addAudioEffect(activatableClassId: string, effectRequired: boolean, configuration: Windows.Foundation.Collections.IPropertySet): void; - addVideoEffect(activatableClassId: string): void; - addVideoEffect(activatableClassId: string, effectRequired: boolean, configuration: Windows.Foundation.Collections.IPropertySet): void; - clearEffects(): void; - prepareFileTranscodeAsync(source: Windows.Storage.IStorageFile, destination: Windows.Storage.IStorageFile, profile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IAsyncOperation; - prepareStreamTranscodeAsync(source: Windows.Storage.Streams.IRandomAccessStream, destination: Windows.Storage.Streams.IRandomAccessStream, profile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IAsyncOperation; - } - export class PrepareTranscodeResult implements Windows.Media.Transcoding.IPrepareTranscodeResult { - canTranscode: boolean; - failureReason: Windows.Media.Transcoding.TranscodeFailureReason; - transcodeAsync(): Windows.Foundation.IAsyncActionWithProgress; - } - export interface IPrepareTranscodeResult { - canTranscode: boolean; - failureReason: Windows.Media.Transcoding.TranscodeFailureReason; - transcodeAsync(): Windows.Foundation.IAsyncActionWithProgress; - } - export class MediaTranscoder implements Windows.Media.Transcoding.IMediaTranscoder { - alwaysReencode: boolean; - hardwareAccelerationEnabled: boolean; - trimStartTime: number; - trimStopTime: number; - addAudioEffect(activatableClassId: string): void; - addAudioEffect(activatableClassId: string, effectRequired: boolean, configuration: Windows.Foundation.Collections.IPropertySet): void; - addVideoEffect(activatableClassId: string): void; - addVideoEffect(activatableClassId: string, effectRequired: boolean, configuration: Windows.Foundation.Collections.IPropertySet): void; - clearEffects(): void; - prepareFileTranscodeAsync(source: Windows.Storage.IStorageFile, destination: Windows.Storage.IStorageFile, profile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IAsyncOperation; - prepareStreamTranscodeAsync(source: Windows.Storage.Streams.IRandomAccessStream, destination: Windows.Storage.Streams.IRandomAccessStream, profile: Windows.Media.MediaProperties.MediaEncodingProfile): Windows.Foundation.IAsyncOperation; - } - } - } -} -declare module Windows { - export module Networking { - export module NetworkOperators { - export enum DataClasses { - none, - gprs, - edge, - umts, - hsdpa, - hsupa, - lteAdvanced, - cdma1xRtt, - cdma1xEvdo, - cdma1xEvdoRevA, - cdma1xEvdv, - cdma3xRtt, - cdma1xEvdoRevB, - cdmaUmb, - custom, - } - export enum MobileBroadbandDeviceType { - unknown, - embedded, - removable, - remote, - } - export enum NetworkDeviceStatus { - deviceNotReady, - deviceReady, - simNotInserted, - badSim, - deviceHardwareFailure, - accountNotActivated, - deviceLocked, - deviceBlocked, - } - export enum NetworkRegistrationState { - none, - deregistered, - searching, - home, - roaming, - partner, - denied, - } - export enum MobileBroadbandRadioState { - off, - on, - } - export enum NetworkOperatorEventMessageType { - gsm, - cdma, - ussd, - dataPlanThresholdReached, - dataPlanReset, - dataPlanDeleted, - profileConnected, - profileDisconnected, - registeredRoaming, - registeredHome, - } - export enum MobileBroadbandAccountWatcherStatus { - created, - started, - enumerationCompleted, - stopped, - aborted, - } - export interface IMobileBroadbandAccountStatics { - availableNetworkAccountIds: Windows.Foundation.Collections.IVectorView; - createFromNetworkAccountId(networkAccountId: string): Windows.Networking.NetworkOperators.MobileBroadbandAccount; - } - export class MobileBroadbandAccount implements Windows.Networking.NetworkOperators.IMobileBroadbandAccount { - currentDeviceInformation: Windows.Networking.NetworkOperators.MobileBroadbandDeviceInformation; - currentNetwork: Windows.Networking.NetworkOperators.MobileBroadbandNetwork; - networkAccountId: string; - serviceProviderGuid: string; - serviceProviderName: string; - static availableNetworkAccountIds: Windows.Foundation.Collections.IVectorView; - static createFromNetworkAccountId(networkAccountId: string): Windows.Networking.NetworkOperators.MobileBroadbandAccount; - } - export interface IMobileBroadbandAccount { - currentDeviceInformation: Windows.Networking.NetworkOperators.MobileBroadbandDeviceInformation; - currentNetwork: Windows.Networking.NetworkOperators.MobileBroadbandNetwork; - networkAccountId: string; - serviceProviderGuid: string; - serviceProviderName: string; - } - export class MobileBroadbandNetwork implements Windows.Networking.NetworkOperators.IMobileBroadbandNetwork { - accessPointName: string; - activationNetworkError: number; - networkAdapter: Windows.Networking.Connectivity.NetworkAdapter; - networkRegistrationState: Windows.Networking.NetworkOperators.NetworkRegistrationState; - packetAttachNetworkError: number; - registeredDataClass: Windows.Networking.NetworkOperators.DataClasses; - registeredProviderId: string; - registeredProviderName: string; - registrationNetworkError: number; - showConnectionUI(): void; - } - export class MobileBroadbandDeviceInformation implements Windows.Networking.NetworkOperators.IMobileBroadbandDeviceInformation { - cellularClass: Windows.Devices.Sms.CellularClass; - currentRadioState: Windows.Networking.NetworkOperators.MobileBroadbandRadioState; - customDataClass: string; - dataClasses: Windows.Networking.NetworkOperators.DataClasses; - deviceId: string; - deviceType: Windows.Networking.NetworkOperators.MobileBroadbandDeviceType; - firmwareInformation: string; - manufacturer: string; - mobileEquipmentId: string; - model: string; - networkDeviceStatus: Windows.Networking.NetworkOperators.NetworkDeviceStatus; - simIccId: string; - subscriberId: string; - telephoneNumbers: Windows.Foundation.Collections.IVectorView; - } - export interface IMobileBroadbandDeviceInformation { - cellularClass: Windows.Devices.Sms.CellularClass; - currentRadioState: Windows.Networking.NetworkOperators.MobileBroadbandRadioState; - customDataClass: string; - dataClasses: Windows.Networking.NetworkOperators.DataClasses; - deviceId: string; - deviceType: Windows.Networking.NetworkOperators.MobileBroadbandDeviceType; - firmwareInformation: string; - manufacturer: string; - mobileEquipmentId: string; - model: string; - networkDeviceStatus: Windows.Networking.NetworkOperators.NetworkDeviceStatus; - simIccId: string; - subscriberId: string; - telephoneNumbers: Windows.Foundation.Collections.IVectorView; - } - export interface IMobileBroadbandNetwork { - accessPointName: string; - activationNetworkError: number; - networkAdapter: Windows.Networking.Connectivity.NetworkAdapter; - networkRegistrationState: Windows.Networking.NetworkOperators.NetworkRegistrationState; - packetAttachNetworkError: number; - registeredDataClass: Windows.Networking.NetworkOperators.DataClasses; - registeredProviderId: string; - registeredProviderName: string; - registrationNetworkError: number; - showConnectionUI(): void; - } - export interface INetworkOperatorNotificationEventDetails { - encodingType: number; - message: string; - networkAccountId: string; - notificationType: Windows.Networking.NetworkOperators.NetworkOperatorEventMessageType; - ruleId: string; - smsMessage: Windows.Devices.Sms.ISmsMessage; - } - export class NetworkOperatorNotificationEventDetails implements Windows.Networking.NetworkOperators.INetworkOperatorNotificationEventDetails { - encodingType: number; - message: string; - networkAccountId: string; - notificationType: Windows.Networking.NetworkOperators.NetworkOperatorEventMessageType; - ruleId: string; - smsMessage: Windows.Devices.Sms.ISmsMessage; - } - export interface IMobileBroadbandAccountEventArgs { - networkAccountId: string; - } - export class MobileBroadbandAccountEventArgs implements Windows.Networking.NetworkOperators.IMobileBroadbandAccountEventArgs { - networkAccountId: string; - } - export interface IMobileBroadbandAccountUpdatedEventArgs { - hasDeviceInformationChanged: boolean; - hasNetworkChanged: boolean; - networkAccountId: string; - } - export class MobileBroadbandAccountUpdatedEventArgs implements Windows.Networking.NetworkOperators.IMobileBroadbandAccountUpdatedEventArgs { - hasDeviceInformationChanged: boolean; - hasNetworkChanged: boolean; - networkAccountId: string; - } - export interface IMobileBroadbandAccountWatcher { - status: Windows.Networking.NetworkOperators.MobileBroadbandAccountWatcherStatus; - onaccountadded: any/* TODO */; - onaccountupdated: any/* TODO */; - onaccountremoved: any/* TODO */; - onenumerationcompleted: any/* TODO */; - onstopped: any/* TODO */; - start(): void; - stop(): void; - } - export class MobileBroadbandAccountWatcher implements Windows.Networking.NetworkOperators.IMobileBroadbandAccountWatcher { - status: Windows.Networking.NetworkOperators.MobileBroadbandAccountWatcherStatus; - onaccountadded: any/* TODO */; - onaccountupdated: any/* TODO */; - onaccountremoved: any/* TODO */; - onenumerationcompleted: any/* TODO */; - onstopped: any/* TODO */; - start(): void; - stop(): void; - } - export interface IHotspotAuthenticationEventDetails { - eventToken: string; - } - export class HotspotAuthenticationEventDetails implements Windows.Networking.NetworkOperators.IHotspotAuthenticationEventDetails { - eventToken: string; - } - export interface IHotspotAuthenticationContextStatics { - tryGetAuthenticationContext(evenToken: string): { context: Windows.Networking.NetworkOperators.HotspotAuthenticationContext; isValid: boolean; }; - } - export class HotspotAuthenticationContext implements Windows.Networking.NetworkOperators.IHotspotAuthenticationContext { - authenticationUrl: Windows.Foundation.Uri; - networkAdapter: Windows.Networking.Connectivity.NetworkAdapter; - redirectMessageUrl: Windows.Foundation.Uri; - redirectMessageXml: Windows.Data.Xml.Dom.XmlDocument; - wirelessNetworkId: Uint8Array; - issueCredentials(userName: string, password: string, extraParameters: string, markAsManualConnectOnFailure: boolean): void; - abortAuthentication(markAsManual: boolean): void; - skipAuthentication(): void; - triggerAttentionRequired(packageRelativeApplicationId: string, applicationParameters: string): void; - static tryGetAuthenticationContext(evenToken: string): { context: Windows.Networking.NetworkOperators.HotspotAuthenticationContext; isValid: boolean; }; - } - export interface IHotspotAuthenticationContext { - authenticationUrl: Windows.Foundation.Uri; - networkAdapter: Windows.Networking.Connectivity.NetworkAdapter; - redirectMessageUrl: Windows.Foundation.Uri; - redirectMessageXml: Windows.Data.Xml.Dom.XmlDocument; - wirelessNetworkId: Uint8Array; - issueCredentials(userName: string, password: string, extraParameters: string, markAsManualConnectOnFailure: boolean): void; - abortAuthentication(markAsManual: boolean): void; - skipAuthentication(): void; - triggerAttentionRequired(packageRelativeApplicationId: string, applicationParameters: string): void; - } - export enum ProfileMediaType { - wlan, - wwan, - } - export interface IProvisionFromXmlDocumentResults { - allElementsProvisioned: boolean; - provisionResultsXml: string; - } - export class ProvisionFromXmlDocumentResults implements Windows.Networking.NetworkOperators.IProvisionFromXmlDocumentResults { - allElementsProvisioned: boolean; - provisionResultsXml: string; - } - export interface ProfileUsage { - usageInMegabytes: number; - lastSyncTime: Date; - } - export interface IProvisionedProfile { - updateCost(value: Windows.Networking.Connectivity.NetworkCostType): void; - updateUsage(value: Windows.Networking.NetworkOperators.ProfileUsage): void; - } - export class ProvisionedProfile implements Windows.Networking.NetworkOperators.IProvisionedProfile { - updateCost(value: Windows.Networking.Connectivity.NetworkCostType): void; - updateUsage(value: Windows.Networking.NetworkOperators.ProfileUsage): void; - } - export interface IProvisioningAgent { - provisionFromXmlDocumentAsync(provisioningXmlDocument: string): Windows.Foundation.IAsyncOperation; - getProvisionedProfile(mediaType: Windows.Networking.NetworkOperators.ProfileMediaType, profileName: string): Windows.Networking.NetworkOperators.ProvisionedProfile; - } - export interface IProvisioningAgentStaticMethods { - createFromNetworkAccountId(networkAccountId: string): Windows.Networking.NetworkOperators.ProvisioningAgent; - } - export class ProvisioningAgent implements Windows.Networking.NetworkOperators.IProvisioningAgent { - provisionFromXmlDocumentAsync(provisioningXmlDocument: string): Windows.Foundation.IAsyncOperation; - getProvisionedProfile(mediaType: Windows.Networking.NetworkOperators.ProfileMediaType, profileName: string): Windows.Networking.NetworkOperators.ProvisionedProfile; - static createFromNetworkAccountId(networkAccountId: string): Windows.Networking.NetworkOperators.ProvisioningAgent; - } - export enum UssdResultCode { - noActionRequired, - actionRequired, - terminated, - otherLocalClient, - operationNotSupported, - networkTimeout, - } - export interface IUssdMessage { - dataCodingScheme: number; - payloadAsText: string; - getPayload(): Uint8Array; - setPayload(value: Uint8Array): void; - } - export interface IUssdMessageFactory { - createMessage(messageText: string): Windows.Networking.NetworkOperators.UssdMessage; - } - export class UssdMessage implements Windows.Networking.NetworkOperators.IUssdMessage { - constructor(messageText: string); - dataCodingScheme: number; - payloadAsText: string; - getPayload(): Uint8Array; - setPayload(value: Uint8Array): void; - } - export interface IUssdReply { - message: Windows.Networking.NetworkOperators.UssdMessage; - resultCode: Windows.Networking.NetworkOperators.UssdResultCode; - } - export class UssdReply implements Windows.Networking.NetworkOperators.IUssdReply { - message: Windows.Networking.NetworkOperators.UssdMessage; - resultCode: Windows.Networking.NetworkOperators.UssdResultCode; - } - export interface IUssdSession { - sendMessageAndGetReplyAsync(message: Windows.Networking.NetworkOperators.UssdMessage): Windows.Foundation.IAsyncOperation; - close(): void; - } - export interface IUssdSessionStatics { - createFromNetworkAccountId(networkAccountId: string): Windows.Networking.NetworkOperators.UssdSession; - createFromNetworkInterfaceId(networkInterfaceId: string): Windows.Networking.NetworkOperators.UssdSession; - } - export class UssdSession implements Windows.Networking.NetworkOperators.IUssdSession { - sendMessageAndGetReplyAsync(message: Windows.Networking.NetworkOperators.UssdMessage): Windows.Foundation.IAsyncOperation; - close(): void; - static createFromNetworkAccountId(networkAccountId: string): Windows.Networking.NetworkOperators.UssdSession; - static createFromNetworkInterfaceId(networkInterfaceId: string): Windows.Networking.NetworkOperators.UssdSession; - } - } - } -} -declare module Windows { - export module Networking { - export module BackgroundTransfer { - export enum BackgroundTransferStatus { - idle, - running, - pausedByApplication, - pausedCostedNetwork, - pausedNoNetwork, - completed, - canceled, - error, - } - export enum BackgroundTransferCostPolicy { - default, - unrestrictedOnly, - always, - } - export interface BackgroundDownloadProgress { - bytesReceived: number; - totalBytesToReceive: number; - status: Windows.Networking.BackgroundTransfer.BackgroundTransferStatus; - hasResponseChanged: boolean; - hasRestarted: boolean; - } - export interface BackgroundUploadProgress { - bytesReceived: number; - bytesSent: number; - totalBytesToReceive: number; - totalBytesToSend: number; - status: Windows.Networking.BackgroundTransfer.BackgroundTransferStatus; - hasResponseChanged: boolean; - hasRestarted: boolean; - } - export interface IBackgroundTransferBase { - costPolicy: Windows.Networking.BackgroundTransfer.BackgroundTransferCostPolicy; - group: string; - method: string; - proxyCredential: Windows.Security.Credentials.PasswordCredential; - serverCredential: Windows.Security.Credentials.PasswordCredential; - setRequestHeader(headerName: string, headerValue: string): void; - } - export interface IBackgroundDownloader extends Windows.Networking.BackgroundTransfer.IBackgroundTransferBase { - createDownload(uri: Windows.Foundation.Uri, resultFile: Windows.Storage.IStorageFile): Windows.Networking.BackgroundTransfer.DownloadOperation; - createDownload(uri: Windows.Foundation.Uri, resultFile: Windows.Storage.IStorageFile, requestBodyFile: Windows.Storage.IStorageFile): Windows.Networking.BackgroundTransfer.DownloadOperation; - createDownloadAsync(uri: Windows.Foundation.Uri, resultFile: Windows.Storage.IStorageFile, requestBodyStream: Windows.Storage.Streams.IInputStream): Windows.Foundation.IAsyncOperation; - } - export class DownloadOperation implements Windows.Networking.BackgroundTransfer.IDownloadOperation, Windows.Networking.BackgroundTransfer.IBackgroundTransferOperation { - progress: Windows.Networking.BackgroundTransfer.BackgroundDownloadProgress; - resultFile: Windows.Storage.IStorageFile; - costPolicy: Windows.Networking.BackgroundTransfer.BackgroundTransferCostPolicy; - group: string; - guid: string; - method: string; - requestedUri: Windows.Foundation.Uri; - startAsync(): Windows.Foundation.IAsyncOperationWithProgress; - attachAsync(): Windows.Foundation.IAsyncOperationWithProgress; - pause(): void; - resume(): void; - getResultStreamAt(position: number): Windows.Storage.Streams.IInputStream; - getResponseInformation(): Windows.Networking.BackgroundTransfer.ResponseInformation; - } - export interface IBackgroundUploader extends Windows.Networking.BackgroundTransfer.IBackgroundTransferBase { - createUpload(uri: Windows.Foundation.Uri, sourceFile: Windows.Storage.IStorageFile): Windows.Networking.BackgroundTransfer.UploadOperation; - createUploadFromStreamAsync(uri: Windows.Foundation.Uri, sourceStream: Windows.Storage.Streams.IInputStream): Windows.Foundation.IAsyncOperation; - createUploadAsync(uri: Windows.Foundation.Uri, parts: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation; - createUploadAsync(uri: Windows.Foundation.Uri, parts: Windows.Foundation.Collections.IIterable, subType: string): Windows.Foundation.IAsyncOperation; - createUploadAsync(uri: Windows.Foundation.Uri, parts: Windows.Foundation.Collections.IIterable, subType: string, boundary: string): Windows.Foundation.IAsyncOperation; - } - export class UploadOperation implements Windows.Networking.BackgroundTransfer.IUploadOperation, Windows.Networking.BackgroundTransfer.IBackgroundTransferOperation { - progress: Windows.Networking.BackgroundTransfer.BackgroundUploadProgress; - sourceFile: Windows.Storage.IStorageFile; - costPolicy: Windows.Networking.BackgroundTransfer.BackgroundTransferCostPolicy; - group: string; - guid: string; - method: string; - requestedUri: Windows.Foundation.Uri; - startAsync(): Windows.Foundation.IAsyncOperationWithProgress; - attachAsync(): Windows.Foundation.IAsyncOperationWithProgress; - getResultStreamAt(position: number): Windows.Storage.Streams.IInputStream; - getResponseInformation(): Windows.Networking.BackgroundTransfer.ResponseInformation; - } - export class BackgroundTransferContentPart implements Windows.Networking.BackgroundTransfer.IBackgroundTransferContentPart { - constructor(name: string); - constructor(name: string, fileName: string); - constructor(); - setHeader(headerName: string, headerValue: string): void; - setText(value: string): void; - setFile(value: Windows.Storage.IStorageFile): void; - } - export interface IBackgroundTransferOperation { - costPolicy: Windows.Networking.BackgroundTransfer.BackgroundTransferCostPolicy; - group: string; - guid: string; - method: string; - requestedUri: Windows.Foundation.Uri; - getResultStreamAt(position: number): Windows.Storage.Streams.IInputStream; - getResponseInformation(): Windows.Networking.BackgroundTransfer.ResponseInformation; - } - export class ResponseInformation implements Windows.Networking.BackgroundTransfer.IResponseInformation { - actualUri: Windows.Foundation.Uri; - headers: Windows.Foundation.Collections.IMapView; - isResumable: boolean; - statusCode: number; - } - export interface IDownloadOperation extends Windows.Networking.BackgroundTransfer.IBackgroundTransferOperation { - progress: Windows.Networking.BackgroundTransfer.BackgroundDownloadProgress; - resultFile: Windows.Storage.IStorageFile; - startAsync(): Windows.Foundation.IAsyncOperationWithProgress; - attachAsync(): Windows.Foundation.IAsyncOperationWithProgress; - pause(): void; - resume(): void; - } - export interface IUploadOperation extends Windows.Networking.BackgroundTransfer.IBackgroundTransferOperation { - progress: Windows.Networking.BackgroundTransfer.BackgroundUploadProgress; - sourceFile: Windows.Storage.IStorageFile; - startAsync(): Windows.Foundation.IAsyncOperationWithProgress; - attachAsync(): Windows.Foundation.IAsyncOperationWithProgress; - } - export interface IBackgroundDownloaderStaticMethods { - getCurrentDownloadsAsync(): Windows.Foundation.IAsyncOperation>; - getCurrentDownloadsAsync(group: string): Windows.Foundation.IAsyncOperation>; - } - export interface IBackgroundUploaderStaticMethods { - getCurrentUploadsAsync(): Windows.Foundation.IAsyncOperation>; - getCurrentUploadsAsync(group: string): Windows.Foundation.IAsyncOperation>; - } - export interface IResponseInformation { - actualUri: Windows.Foundation.Uri; - headers: Windows.Foundation.Collections.IMapView; - isResumable: boolean; - statusCode: number; - } - export interface IBackgroundTransferErrorStaticMethods { - getStatus(hresult: number): Windows.Web.WebErrorStatus; - } - export interface IBackgroundTransferContentPart { - setHeader(headerName: string, headerValue: string): void; - setText(value: string): void; - setFile(value: Windows.Storage.IStorageFile): void; - } - export interface IBackgroundTransferContentPartFactory { - createWithName(name: string): Windows.Networking.BackgroundTransfer.BackgroundTransferContentPart; - createWithNameAndFileName(name: string, fileName: string): Windows.Networking.BackgroundTransfer.BackgroundTransferContentPart; - } - export class BackgroundDownloader implements Windows.Networking.BackgroundTransfer.IBackgroundDownloader, Windows.Networking.BackgroundTransfer.IBackgroundTransferBase { - costPolicy: Windows.Networking.BackgroundTransfer.BackgroundTransferCostPolicy; - group: string; - method: string; - proxyCredential: Windows.Security.Credentials.PasswordCredential; - serverCredential: Windows.Security.Credentials.PasswordCredential; - createDownload(uri: Windows.Foundation.Uri, resultFile: Windows.Storage.IStorageFile): Windows.Networking.BackgroundTransfer.DownloadOperation; - createDownload(uri: Windows.Foundation.Uri, resultFile: Windows.Storage.IStorageFile, requestBodyFile: Windows.Storage.IStorageFile): Windows.Networking.BackgroundTransfer.DownloadOperation; - createDownloadAsync(uri: Windows.Foundation.Uri, resultFile: Windows.Storage.IStorageFile, requestBodyStream: Windows.Storage.Streams.IInputStream): Windows.Foundation.IAsyncOperation; - setRequestHeader(headerName: string, headerValue: string): void; - static getCurrentDownloadsAsync(): Windows.Foundation.IAsyncOperation>; - static getCurrentDownloadsAsync(group: string): Windows.Foundation.IAsyncOperation>; - } - export class BackgroundUploader implements Windows.Networking.BackgroundTransfer.IBackgroundUploader, Windows.Networking.BackgroundTransfer.IBackgroundTransferBase { - costPolicy: Windows.Networking.BackgroundTransfer.BackgroundTransferCostPolicy; - group: string; - method: string; - proxyCredential: Windows.Security.Credentials.PasswordCredential; - serverCredential: Windows.Security.Credentials.PasswordCredential; - createUpload(uri: Windows.Foundation.Uri, sourceFile: Windows.Storage.IStorageFile): Windows.Networking.BackgroundTransfer.UploadOperation; - createUploadFromStreamAsync(uri: Windows.Foundation.Uri, sourceStream: Windows.Storage.Streams.IInputStream): Windows.Foundation.IAsyncOperation; - createUploadAsync(uri: Windows.Foundation.Uri, parts: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation; - createUploadAsync(uri: Windows.Foundation.Uri, parts: Windows.Foundation.Collections.IIterable, subType: string): Windows.Foundation.IAsyncOperation; - createUploadAsync(uri: Windows.Foundation.Uri, parts: Windows.Foundation.Collections.IIterable, subType: string, boundary: string): Windows.Foundation.IAsyncOperation; - setRequestHeader(headerName: string, headerValue: string): void; - static getCurrentUploadsAsync(): Windows.Foundation.IAsyncOperation>; - static getCurrentUploadsAsync(group: string): Windows.Foundation.IAsyncOperation>; - } - export class BackgroundTransferError { - static getStatus(hresult: number): Windows.Web.WebErrorStatus; - } - } - } -} -declare module Windows { - export module Networking { - export module Proximity { - export interface IProximityMessage { - data: Windows.Storage.Streams.IBuffer; - dataAsString: string; - messageType: string; - subscriptionId: number; - } - export class ProximityMessage implements Windows.Networking.Proximity.IProximityMessage { - data: Windows.Storage.Streams.IBuffer; - dataAsString: string; - messageType: string; - subscriptionId: number; - } - export interface MessageReceivedHandler { - (sender: Windows.Networking.Proximity.ProximityDevice, message: Windows.Networking.Proximity.ProximityMessage): void; - } - export class ProximityDevice implements Windows.Networking.Proximity.IProximityDevice { - bitsPerSecond: number; - deviceId: string; - maxMessageBytes: number; - subscribeForMessage(messageType: string, messageReceivedHandler: Windows.Networking.Proximity.MessageReceivedHandler): number; - publishMessage(messageType: string, message: string): number; - publishMessage(messageType: string, message: string, messageTransmittedHandler: Windows.Networking.Proximity.MessageTransmittedHandler): number; - publishBinaryMessage(messageType: string, message: Windows.Storage.Streams.IBuffer): number; - publishBinaryMessage(messageType: string, message: Windows.Storage.Streams.IBuffer, messageTransmittedHandler: Windows.Networking.Proximity.MessageTransmittedHandler): number; - publishUriMessage(message: Windows.Foundation.Uri): number; - publishUriMessage(message: Windows.Foundation.Uri, messageTransmittedHandler: Windows.Networking.Proximity.MessageTransmittedHandler): number; - stopSubscribingForMessage(subscriptionId: number): void; - stopPublishingMessage(messageId: number): void; - ondevicearrived: any/* TODO */; - ondevicedeparted: any/* TODO */; - static getDeviceSelector(): string; - static getDefault(): Windows.Networking.Proximity.ProximityDevice; - static fromId(deviceInterfaceId: string): Windows.Networking.Proximity.ProximityDevice; - } - export interface MessageTransmittedHandler { - (sender: Windows.Networking.Proximity.ProximityDevice, messageId: number): void; - } - export interface DeviceArrivedEventHandler { - (sender: Windows.Networking.Proximity.ProximityDevice): void; - } - export interface DeviceDepartedEventHandler { - (sender: Windows.Networking.Proximity.ProximityDevice): void; - } - export interface IProximityDevice { - bitsPerSecond: number; - deviceId: string; - maxMessageBytes: number; - subscribeForMessage(messageType: string, messageReceivedHandler: Windows.Networking.Proximity.MessageReceivedHandler): number; - publishMessage(messageType: string, message: string): number; - publishMessage(messageType: string, message: string, messageTransmittedHandler: Windows.Networking.Proximity.MessageTransmittedHandler): number; - publishBinaryMessage(messageType: string, message: Windows.Storage.Streams.IBuffer): number; - publishBinaryMessage(messageType: string, message: Windows.Storage.Streams.IBuffer, messageTransmittedHandler: Windows.Networking.Proximity.MessageTransmittedHandler): number; - publishUriMessage(message: Windows.Foundation.Uri): number; - publishUriMessage(message: Windows.Foundation.Uri, messageTransmittedHandler: Windows.Networking.Proximity.MessageTransmittedHandler): number; - stopSubscribingForMessage(subscriptionId: number): void; - stopPublishingMessage(messageId: number): void; - ondevicearrived: any/* TODO */; - ondevicedeparted: any/* TODO */; - } - export interface IProximityDeviceStatics { - getDeviceSelector(): string; - getDefault(): Windows.Networking.Proximity.ProximityDevice; - fromId(deviceInterfaceId: string): Windows.Networking.Proximity.ProximityDevice; - } - export enum TriggeredConnectState { - peerFound, - listening, - connecting, - completed, - canceled, - failed, - } - export interface ITriggeredConnectionStateChangedEventArgs { - id: number; - socket: Windows.Networking.Sockets.StreamSocket; - state: Windows.Networking.Proximity.TriggeredConnectState; - } - export class TriggeredConnectionStateChangedEventArgs implements Windows.Networking.Proximity.ITriggeredConnectionStateChangedEventArgs { - id: number; - socket: Windows.Networking.Sockets.StreamSocket; - state: Windows.Networking.Proximity.TriggeredConnectState; - } - export interface IPeerInformation { - displayName: string; - } - export class PeerInformation implements Windows.Networking.Proximity.IPeerInformation { - displayName: string; - } - export interface IConnectionRequestedEventArgs { - peerInformation: Windows.Networking.Proximity.PeerInformation; - } - export class ConnectionRequestedEventArgs implements Windows.Networking.Proximity.IConnectionRequestedEventArgs { - peerInformation: Windows.Networking.Proximity.PeerInformation; - } - export enum PeerDiscoveryTypes { - none, - browse, - triggered, - } - export interface IPeerFinderStatics { - allowBluetooth: boolean; - allowInfrastructure: boolean; - allowWiFiDirect: boolean; - alternateIdentities: Windows.Foundation.Collections.IMap; - displayName: string; - supportedDiscoveryTypes: Windows.Networking.Proximity.PeerDiscoveryTypes; - start(): void; - start(peerMessage: string): void; - stop(): void; - ontriggeredconnectionstatechanged: any/* TODO */; - onconnectionrequested: any/* TODO */; - findAllPeersAsync(): Windows.Foundation.IAsyncOperation>; - connectAsync(peerInformation: Windows.Networking.Proximity.PeerInformation): Windows.Foundation.IAsyncOperation; - } - export class PeerFinder { - static allowBluetooth: boolean; - static allowInfrastructure: boolean; - static allowWiFiDirect: boolean; - static alternateIdentities: Windows.Foundation.Collections.IMap; - static displayName: string; - static supportedDiscoveryTypes: Windows.Networking.Proximity.PeerDiscoveryTypes; - static start(): void; - static start(peerMessage: string): void; - static stop(): void; - static ontriggeredconnectionstatechanged: any/* TODO */; - static onconnectionrequested: any/* TODO */; - static findAllPeersAsync(): Windows.Foundation.IAsyncOperation>; - static connectAsync(peerInformation: Windows.Networking.Proximity.PeerInformation): Windows.Foundation.IAsyncOperation; - } - } - } -} -declare module Windows { - export module Networking { - export module Sockets { - export enum ControlChannelTriggerStatus { - hardwareSlotRequested, - softwareSlotAllocated, - hardwareSlotAllocated, - policyError, - systemError, - transportDisconnected, - serviceUnavailable, - } - export enum ControlChannelTriggerResourceType { - requestSoftwareSlot, - requestHardwareSlot, - } - export enum ControlChannelTriggerResetReason { - fastUserSwitched, - lowPowerExit, - } - export interface IControlChannelTrigger extends Windows.Foundation.IClosable { - controlChannelTriggerId: string; - currentKeepAliveIntervalInMinutes: number; - keepAliveTrigger: Windows.ApplicationModel.Background.IBackgroundTrigger; - pushNotificationTrigger: Windows.ApplicationModel.Background.IBackgroundTrigger; - serverKeepAliveIntervalInMinutes: number; - transportObject: any; - usingTransport(transport: any): void; - waitForPushEnabled(): Windows.Networking.Sockets.ControlChannelTriggerStatus; - decreaseNetworkKeepAliveInterval(): void; - flushTransport(): void; - } - export interface IControlChannelTriggerFactory { - createControlChannelTrigger(channelId: string, serverKeepAliveIntervalInMinutes: number): Windows.Networking.Sockets.ControlChannelTrigger; - createControlChannelTrigger(channelId: string, serverKeepAliveIntervalInMinutes: number, resourceRequestType: Windows.Networking.Sockets.ControlChannelTriggerResourceType): Windows.Networking.Sockets.ControlChannelTrigger; - } - export class ControlChannelTrigger implements Windows.Networking.Sockets.IControlChannelTrigger, Windows.Foundation.IClosable { - constructor(channelId: string, serverKeepAliveIntervalInMinutes: number); - constructor(channelId: string, serverKeepAliveIntervalInMinutes: number, resourceRequestType: Windows.Networking.Sockets.ControlChannelTriggerResourceType); - controlChannelTriggerId: string; - currentKeepAliveIntervalInMinutes: number; - keepAliveTrigger: Windows.ApplicationModel.Background.IBackgroundTrigger; - pushNotificationTrigger: Windows.ApplicationModel.Background.IBackgroundTrigger; - serverKeepAliveIntervalInMinutes: number; - transportObject: any; - usingTransport(transport: any): void; - waitForPushEnabled(): Windows.Networking.Sockets.ControlChannelTriggerStatus; - decreaseNetworkKeepAliveInterval(): void; - flushTransport(): void; - dispose(): void; - close(): void; - } - export interface IControlChannelTriggerEventDetails { - controlChannelTrigger: Windows.Networking.Sockets.ControlChannelTrigger; - } - export interface IControlChannelTriggerResetEventDetails { - hardwareSlotReset: boolean; - resetReason: Windows.Networking.Sockets.ControlChannelTriggerResetReason; - softwareSlotReset: boolean; - } - export enum SocketMessageType { - binary, - utf8, - } - export enum SocketProtectionLevel { - plainSocket, - ssl, - sslAllowNullEncryption, - } - export enum SocketQualityOfService { - normal, - lowLatency, - } - export enum SocketErrorStatus { - unknown, - operationAborted, - httpInvalidServerResponse, - connectionTimedOut, - addressFamilyNotSupported, - socketTypeNotSupported, - hostNotFound, - noDataRecordOfRequestedType, - nonAuthoritativeHostNotFound, - classTypeNotFound, - addressAlreadyInUse, - cannotAssignRequestedAddress, - connectionRefused, - networkIsUnreachable, - unreachableHost, - networkIsDown, - networkDroppedConnectionOnReset, - softwareCausedConnectionAbort, - connectionResetByPeer, - hostIsDown, - noAddressesFound, - tooManyOpenFiles, - messageTooLong, - certificateExpired, - certificateUntrustedRoot, - certificateCommonNameIsIncorrect, - certificateWrongUsage, - certificateRevoked, - certificateNoRevocationCheck, - certificateRevocationServerOffline, - certificateIsInvalid, - } - export interface RoundTripTimeStatistics { - variance: number; - max: number; - min: number; - sum: number; - } - export interface BandwidthStatistics { - outboundBitsPerSecond: number; - inboundBitsPerSecond: number; - outboundBitsPerSecondInstability: number; - inboundBitsPerSecondInstability: number; - outboundBandwidthPeaked: boolean; - inboundBandwidthPeaked: boolean; - } - export interface IDatagramSocketMessageReceivedEventArgs { - localAddress: Windows.Networking.HostName; - remoteAddress: Windows.Networking.HostName; - remotePort: string; - getDataReader(): Windows.Storage.Streams.DataReader; - getDataStream(): Windows.Storage.Streams.IInputStream; - } - export interface IMessageWebSocketMessageReceivedEventArgs { - messageType: Windows.Networking.Sockets.SocketMessageType; - getDataReader(): Windows.Storage.Streams.DataReader; - getDataStream(): Windows.Storage.Streams.IInputStream; - } - export interface IWebSocketClosedEventArgs { - code: number; - reason: string; - } - export interface IDatagramSocketInformation { - localAddress: Windows.Networking.HostName; - localPort: string; - remoteAddress: Windows.Networking.HostName; - remotePort: string; - } - export interface IDatagramSocketControl { - outboundUnicastHopLimit: number; - qualityOfService: Windows.Networking.Sockets.SocketQualityOfService; - } - export interface IDatagramSocketStatics { - getEndpointPairsAsync(remoteHostName: Windows.Networking.HostName, remoteServiceName: string): Windows.Foundation.IAsyncOperation>; - getEndpointPairsAsync(remoteHostName: Windows.Networking.HostName, remoteServiceName: string, sortOptions: Windows.Networking.HostNameSortOptions): Windows.Foundation.IAsyncOperation>; - } - export interface IDatagramSocket extends Windows.Foundation.IClosable { - control: Windows.Networking.Sockets.DatagramSocketControl; - information: Windows.Networking.Sockets.DatagramSocketInformation; - outputStream: Windows.Storage.Streams.IOutputStream; - connectAsync(remoteHostName: Windows.Networking.HostName, remoteServiceName: string): Windows.Foundation.IAsyncAction; - connectAsync(endpointPair: Windows.Networking.EndpointPair): Windows.Foundation.IAsyncAction; - bindServiceNameAsync(localServiceName: string): Windows.Foundation.IAsyncAction; - bindEndpointAsync(localHostName: Windows.Networking.HostName, localServiceName: string): Windows.Foundation.IAsyncAction; - joinMulticastGroup(host: Windows.Networking.HostName): void; - getOutputStreamAsync(remoteHostName: Windows.Networking.HostName, remoteServiceName: string): Windows.Foundation.IAsyncOperation; - getOutputStreamAsync(endpointPair: Windows.Networking.EndpointPair): Windows.Foundation.IAsyncOperation; - onmessagereceived: any/* TODO */; - } - export class DatagramSocketControl implements Windows.Networking.Sockets.IDatagramSocketControl { - outboundUnicastHopLimit: number; - qualityOfService: Windows.Networking.Sockets.SocketQualityOfService; - } - export class DatagramSocketInformation implements Windows.Networking.Sockets.IDatagramSocketInformation { - localAddress: Windows.Networking.HostName; - localPort: string; - remoteAddress: Windows.Networking.HostName; - remotePort: string; - } - export class DatagramSocket implements Windows.Networking.Sockets.IDatagramSocket, Windows.Foundation.IClosable { - control: Windows.Networking.Sockets.DatagramSocketControl; - information: Windows.Networking.Sockets.DatagramSocketInformation; - outputStream: Windows.Storage.Streams.IOutputStream; - connectAsync(remoteHostName: Windows.Networking.HostName, remoteServiceName: string): Windows.Foundation.IAsyncAction; - connectAsync(endpointPair: Windows.Networking.EndpointPair): Windows.Foundation.IAsyncAction; - bindServiceNameAsync(localServiceName: string): Windows.Foundation.IAsyncAction; - bindEndpointAsync(localHostName: Windows.Networking.HostName, localServiceName: string): Windows.Foundation.IAsyncAction; - joinMulticastGroup(host: Windows.Networking.HostName): void; - getOutputStreamAsync(remoteHostName: Windows.Networking.HostName, remoteServiceName: string): Windows.Foundation.IAsyncOperation; - getOutputStreamAsync(endpointPair: Windows.Networking.EndpointPair): Windows.Foundation.IAsyncOperation; - onmessagereceived: any/* TODO */; - dispose(): void; - static getEndpointPairsAsync(remoteHostName: Windows.Networking.HostName, remoteServiceName: string): Windows.Foundation.IAsyncOperation>; - static getEndpointPairsAsync(remoteHostName: Windows.Networking.HostName, remoteServiceName: string, sortOptions: Windows.Networking.HostNameSortOptions): Windows.Foundation.IAsyncOperation>; - close(): void; - } - export class DatagramSocketMessageReceivedEventArgs implements Windows.Networking.Sockets.IDatagramSocketMessageReceivedEventArgs { - localAddress: Windows.Networking.HostName; - remoteAddress: Windows.Networking.HostName; - remotePort: string; - getDataReader(): Windows.Storage.Streams.DataReader; - getDataStream(): Windows.Storage.Streams.IInputStream; - } - export interface IStreamSocketInformation { - bandwidthStatistics: Windows.Networking.Sockets.BandwidthStatistics; - localAddress: Windows.Networking.HostName; - localPort: string; - protectionLevel: Windows.Networking.Sockets.SocketProtectionLevel; - remoteAddress: Windows.Networking.HostName; - remoteHostName: Windows.Networking.HostName; - remotePort: string; - remoteServiceName: string; - roundTripTimeStatistics: Windows.Networking.Sockets.RoundTripTimeStatistics; - sessionKey: Windows.Storage.Streams.IBuffer; - } - export interface IStreamSocketControl { - keepAlive: boolean; - noDelay: boolean; - outboundBufferSizeInBytes: number; - outboundUnicastHopLimit: number; - qualityOfService: Windows.Networking.Sockets.SocketQualityOfService; - } - export interface IStreamSocket extends Windows.Foundation.IClosable { - control: Windows.Networking.Sockets.StreamSocketControl; - information: Windows.Networking.Sockets.StreamSocketInformation; - inputStream: Windows.Storage.Streams.IInputStream; - outputStream: Windows.Storage.Streams.IOutputStream; - connectAsync(endpointPair: Windows.Networking.EndpointPair): Windows.Foundation.IAsyncAction; - connectAsync(remoteHostName: Windows.Networking.HostName, remoteServiceName: string): Windows.Foundation.IAsyncAction; - connectAsync(endpointPair: Windows.Networking.EndpointPair, protectionLevel: Windows.Networking.Sockets.SocketProtectionLevel): Windows.Foundation.IAsyncAction; - connectAsync(remoteHostName: Windows.Networking.HostName, remoteServiceName: string, protectionLevel: Windows.Networking.Sockets.SocketProtectionLevel): Windows.Foundation.IAsyncAction; - upgradeToSslAsync(protectionLevel: Windows.Networking.Sockets.SocketProtectionLevel, validationHostName: Windows.Networking.HostName): Windows.Foundation.IAsyncAction; - } - export class StreamSocketControl implements Windows.Networking.Sockets.IStreamSocketControl { - keepAlive: boolean; - noDelay: boolean; - outboundBufferSizeInBytes: number; - outboundUnicastHopLimit: number; - qualityOfService: Windows.Networking.Sockets.SocketQualityOfService; - } - export class StreamSocketInformation implements Windows.Networking.Sockets.IStreamSocketInformation { - bandwidthStatistics: Windows.Networking.Sockets.BandwidthStatistics; - localAddress: Windows.Networking.HostName; - localPort: string; - protectionLevel: Windows.Networking.Sockets.SocketProtectionLevel; - remoteAddress: Windows.Networking.HostName; - remoteHostName: Windows.Networking.HostName; - remotePort: string; - remoteServiceName: string; - roundTripTimeStatistics: Windows.Networking.Sockets.RoundTripTimeStatistics; - sessionKey: Windows.Storage.Streams.IBuffer; - } - export interface IStreamSocketListenerControl { - qualityOfService: Windows.Networking.Sockets.SocketQualityOfService; - } - export interface IStreamSocketListenerInformation { - localPort: string; - } - export interface IStreamSocketListenerConnectionReceivedEventArgs { - socket: Windows.Networking.Sockets.StreamSocket; - } - export class StreamSocket implements Windows.Networking.Sockets.IStreamSocket, Windows.Foundation.IClosable { - control: Windows.Networking.Sockets.StreamSocketControl; - information: Windows.Networking.Sockets.StreamSocketInformation; - inputStream: Windows.Storage.Streams.IInputStream; - outputStream: Windows.Storage.Streams.IOutputStream; - connectAsync(endpointPair: Windows.Networking.EndpointPair): Windows.Foundation.IAsyncAction; - connectAsync(remoteHostName: Windows.Networking.HostName, remoteServiceName: string): Windows.Foundation.IAsyncAction; - connectAsync(endpointPair: Windows.Networking.EndpointPair, protectionLevel: Windows.Networking.Sockets.SocketProtectionLevel): Windows.Foundation.IAsyncAction; - connectAsync(remoteHostName: Windows.Networking.HostName, remoteServiceName: string, protectionLevel: Windows.Networking.Sockets.SocketProtectionLevel): Windows.Foundation.IAsyncAction; - upgradeToSslAsync(protectionLevel: Windows.Networking.Sockets.SocketProtectionLevel, validationHostName: Windows.Networking.HostName): Windows.Foundation.IAsyncAction; - dispose(): void; - close(): void; - } - export interface IStreamSocketListener extends Windows.Foundation.IClosable { - control: Windows.Networking.Sockets.StreamSocketListenerControl; - information: Windows.Networking.Sockets.StreamSocketListenerInformation; - bindServiceNameAsync(localServiceName: string): Windows.Foundation.IAsyncAction; - bindEndpointAsync(localHostName: Windows.Networking.HostName, localServiceName: string): Windows.Foundation.IAsyncAction; - onconnectionreceived: any/* TODO */; - } - export class StreamSocketListenerControl implements Windows.Networking.Sockets.IStreamSocketListenerControl { - qualityOfService: Windows.Networking.Sockets.SocketQualityOfService; - } - export class StreamSocketListenerInformation implements Windows.Networking.Sockets.IStreamSocketListenerInformation { - localPort: string; - } - export class StreamSocketListener implements Windows.Networking.Sockets.IStreamSocketListener, Windows.Foundation.IClosable { - control: Windows.Networking.Sockets.StreamSocketListenerControl; - information: Windows.Networking.Sockets.StreamSocketListenerInformation; - bindServiceNameAsync(localServiceName: string): Windows.Foundation.IAsyncAction; - bindEndpointAsync(localHostName: Windows.Networking.HostName, localServiceName: string): Windows.Foundation.IAsyncAction; - onconnectionreceived: any/* TODO */; - dispose(): void; - close(): void; - } - export class StreamSocketListenerConnectionReceivedEventArgs implements Windows.Networking.Sockets.IStreamSocketListenerConnectionReceivedEventArgs { - socket: Windows.Networking.Sockets.StreamSocket; - } - export interface IWebSocketControl { - outboundBufferSizeInBytes: number; - proxyCredential: Windows.Security.Credentials.PasswordCredential; - serverCredential: Windows.Security.Credentials.PasswordCredential; - supportedProtocols: Windows.Foundation.Collections.IVector; - } - export interface IWebSocketInformation { - bandwidthStatistics: Windows.Networking.Sockets.BandwidthStatistics; - localAddress: Windows.Networking.HostName; - protocol: string; - } - export interface IWebSocket extends Windows.Foundation.IClosable { - outputStream: Windows.Storage.Streams.IOutputStream; - connectAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncAction; - setRequestHeader(headerName: string, headerValue: string): void; - onclosed: any/* TODO */; - close(): void; - close(code: number, reason: string): void; - } - export class WebSocketClosedEventArgs implements Windows.Networking.Sockets.IWebSocketClosedEventArgs { - code: number; - reason: string; - } - export interface IMessageWebSocketControl extends Windows.Networking.Sockets.IWebSocketControl { - maxMessageSize: number; - messageType: Windows.Networking.Sockets.SocketMessageType; - } - export interface IMessageWebSocket extends Windows.Networking.Sockets.IWebSocket { - control: Windows.Networking.Sockets.MessageWebSocketControl; - information: Windows.Networking.Sockets.MessageWebSocketInformation; - onmessagereceived: any/* TODO */; - } - export class MessageWebSocketControl implements Windows.Networking.Sockets.IMessageWebSocketControl, Windows.Networking.Sockets.IWebSocketControl { - maxMessageSize: number; - messageType: Windows.Networking.Sockets.SocketMessageType; - outboundBufferSizeInBytes: number; - proxyCredential: Windows.Security.Credentials.PasswordCredential; - serverCredential: Windows.Security.Credentials.PasswordCredential; - supportedProtocols: Windows.Foundation.Collections.IVector; - } - export class MessageWebSocketInformation implements Windows.Networking.Sockets.IWebSocketInformation { - bandwidthStatistics: Windows.Networking.Sockets.BandwidthStatistics; - localAddress: Windows.Networking.HostName; - protocol: string; - } - export class MessageWebSocket implements Windows.Networking.Sockets.IMessageWebSocket, Windows.Networking.Sockets.IWebSocket, Windows.Foundation.IClosable { - control: Windows.Networking.Sockets.MessageWebSocketControl; - information: Windows.Networking.Sockets.MessageWebSocketInformation; - outputStream: Windows.Storage.Streams.IOutputStream; - onmessagereceived: any/* TODO */; - connectAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncAction; - setRequestHeader(headerName: string, headerValue: string): void; - onclosed: any/* TODO */; - close(code: number, reason: string): void; - dispose(): void; - close(): void; - } - export class MessageWebSocketMessageReceivedEventArgs implements Windows.Networking.Sockets.IMessageWebSocketMessageReceivedEventArgs { - messageType: Windows.Networking.Sockets.SocketMessageType; - getDataReader(): Windows.Storage.Streams.DataReader; - getDataStream(): Windows.Storage.Streams.IInputStream; - } - export interface IStreamWebSocketControl extends Windows.Networking.Sockets.IWebSocketControl { - noDelay: boolean; - } - export interface IStreamWebSocket extends Windows.Networking.Sockets.IWebSocket { - control: Windows.Networking.Sockets.StreamWebSocketControl; - information: Windows.Networking.Sockets.StreamWebSocketInformation; - inputStream: Windows.Storage.Streams.IInputStream; - } - export class StreamWebSocketControl implements Windows.Networking.Sockets.IStreamWebSocketControl, Windows.Networking.Sockets.IWebSocketControl { - noDelay: boolean; - outboundBufferSizeInBytes: number; - proxyCredential: Windows.Security.Credentials.PasswordCredential; - serverCredential: Windows.Security.Credentials.PasswordCredential; - supportedProtocols: Windows.Foundation.Collections.IVector; - } - export class StreamWebSocketInformation implements Windows.Networking.Sockets.IWebSocketInformation { - bandwidthStatistics: Windows.Networking.Sockets.BandwidthStatistics; - localAddress: Windows.Networking.HostName; - protocol: string; - } - export interface ISocketErrorStatics { - getStatus(hresult: number): Windows.Networking.Sockets.SocketErrorStatus; - } - export interface IWebSocketErrorStatics { - getStatus(hresult: number): Windows.Web.WebErrorStatus; - } - export class StreamWebSocket implements Windows.Networking.Sockets.IStreamWebSocket, Windows.Networking.Sockets.IWebSocket, Windows.Foundation.IClosable { - control: Windows.Networking.Sockets.StreamWebSocketControl; - information: Windows.Networking.Sockets.StreamWebSocketInformation; - inputStream: Windows.Storage.Streams.IInputStream; - outputStream: Windows.Storage.Streams.IOutputStream; - connectAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncAction; - setRequestHeader(headerName: string, headerValue: string): void; - onclosed: any/* TODO */; - close(code: number, reason: string): void; - dispose(): void; - close(): void; - } - export class WebSocketKeepAlive implements Windows.ApplicationModel.Background.IBackgroundTask { - run(taskInstance: Windows.ApplicationModel.Background.IBackgroundTaskInstance): void; - } - export class SocketError { - static getStatus(hresult: number): Windows.Networking.Sockets.SocketErrorStatus; - } - export class WebSocketError { - static getStatus(hresult: number): Windows.Web.WebErrorStatus; - } - } - } -} -declare module Windows { - export module Networking { - export enum HostNameSortOptions { - none, - optimizeForLongConnections, - } - export enum HostNameType { - domainName, - ipv4, - ipv6, - bluetooth, - } - export interface IHostNameStatics { - compare(value1: string, value2: string): number; - } - export interface IHostName { - canonicalName: string; - displayName: string; - iPInformation: Windows.Networking.Connectivity.IPInformation; - rawName: string; - type: Windows.Networking.HostNameType; - isEqual(hostName: Windows.Networking.HostName): boolean; - } - export class HostName implements Windows.Networking.IHostName { - constructor(hostName: string); - canonicalName: string; - displayName: string; - iPInformation: Windows.Networking.Connectivity.IPInformation; - rawName: string; - type: Windows.Networking.HostNameType; - isEqual(hostName: Windows.Networking.HostName): boolean; - static compare(value1: string, value2: string): number; - } - export interface IHostNameFactory { - createHostName(hostName: string): Windows.Networking.HostName; - } - export interface IEndpointPair { - localHostName: Windows.Networking.HostName; - localServiceName: string; - remoteHostName: Windows.Networking.HostName; - remoteServiceName: string; - } - export interface IEndpointPairFactory { - createEndpointPair(localHostName: Windows.Networking.HostName, localServiceName: string, remoteHostName: Windows.Networking.HostName, remoteServiceName: string): Windows.Networking.EndpointPair; - } - export class EndpointPair implements Windows.Networking.IEndpointPair { - constructor(localHostName: Windows.Networking.HostName, localServiceName: string, remoteHostName: Windows.Networking.HostName, remoteServiceName: string); - localHostName: Windows.Networking.HostName; - localServiceName: string; - remoteHostName: Windows.Networking.HostName; - remoteServiceName: string; - } - } -} -declare module Windows { - export module Networking { - export module Connectivity { - export class IPInformation implements Windows.Networking.Connectivity.IIPInformation { - networkAdapter: Windows.Networking.Connectivity.NetworkAdapter; - prefixLength: number; - } - export enum NetworkCostType { - unknown, - unrestricted, - fixed, - variable, - } - export enum NetworkConnectivityLevel { - none, - localAccess, - constrainedInternetAccess, - internetAccess, - } - export enum NetworkTypes { - none, - internet, - privateNetwork, - } - export enum RoamingStates { - none, - notRoaming, - roaming, - } - export enum NetworkAuthenticationType { - none, - unknown, - open80211, - sharedKey80211, - wpa, - wpaPsk, - wpaNone, - rsna, - rsnaPsk, - ihv, - } - export enum NetworkEncryptionType { - none, - unknown, - wep, - wep40, - wep104, - tkip, - ccmp, - wpaUseGroup, - rsnUseGroup, - ihv, - } - export interface IDataUsage { - bytesReceived: number; - bytesSent: number; - } - export interface IDataPlanUsage { - lastSyncTime: Date; - megabytesUsed: number; - } - export interface IDataPlanStatus { - dataLimitInMegabytes: number; - dataPlanUsage: Windows.Networking.Connectivity.DataPlanUsage; - inboundBitsPerSecond: number; - maxTransferSizeInMegabytes: number; - nextBillingCycle: Date; - outboundBitsPerSecond: number; - } - export class DataPlanUsage implements Windows.Networking.Connectivity.IDataPlanUsage { - lastSyncTime: Date; - megabytesUsed: number; - } - export interface IConnectionCost { - approachingDataLimit: boolean; - networkCostType: Windows.Networking.Connectivity.NetworkCostType; - overDataLimit: boolean; - roaming: boolean; - } - export interface INetworkSecuritySettings { - networkAuthenticationType: Windows.Networking.Connectivity.NetworkAuthenticationType; - networkEncryptionType: Windows.Networking.Connectivity.NetworkEncryptionType; - } - export interface IConnectionProfile { - networkAdapter: Windows.Networking.Connectivity.NetworkAdapter; - networkSecuritySettings: Windows.Networking.Connectivity.NetworkSecuritySettings; - profileName: string; - getNetworkConnectivityLevel(): Windows.Networking.Connectivity.NetworkConnectivityLevel; - getNetworkNames(): Windows.Foundation.Collections.IVectorView; - getConnectionCost(): Windows.Networking.Connectivity.ConnectionCost; - getDataPlanStatus(): Windows.Networking.Connectivity.DataPlanStatus; - getLocalUsage(StartTime: Date, EndTime: Date): Windows.Networking.Connectivity.DataUsage; - getLocalUsage(StartTime: Date, EndTime: Date, States: Windows.Networking.Connectivity.RoamingStates): Windows.Networking.Connectivity.DataUsage; - } - export class ConnectionCost implements Windows.Networking.Connectivity.IConnectionCost { - approachingDataLimit: boolean; - networkCostType: Windows.Networking.Connectivity.NetworkCostType; - overDataLimit: boolean; - roaming: boolean; - } - export class DataPlanStatus implements Windows.Networking.Connectivity.IDataPlanStatus { - dataLimitInMegabytes: number; - dataPlanUsage: Windows.Networking.Connectivity.DataPlanUsage; - inboundBitsPerSecond: number; - maxTransferSizeInMegabytes: number; - nextBillingCycle: Date; - outboundBitsPerSecond: number; - } - export class NetworkAdapter implements Windows.Networking.Connectivity.INetworkAdapter { - ianaInterfaceType: number; - inboundMaxBitsPerSecond: number; - networkAdapterId: string; - networkItem: Windows.Networking.Connectivity.NetworkItem; - outboundMaxBitsPerSecond: number; - getConnectedProfileAsync(): Windows.Foundation.IAsyncOperation; - } - export class DataUsage implements Windows.Networking.Connectivity.IDataUsage { - bytesReceived: number; - bytesSent: number; - } - export class NetworkSecuritySettings implements Windows.Networking.Connectivity.INetworkSecuritySettings { - networkAuthenticationType: Windows.Networking.Connectivity.NetworkAuthenticationType; - networkEncryptionType: Windows.Networking.Connectivity.NetworkEncryptionType; - } - export interface ILanIdentifierData { - type: number; - value: Windows.Foundation.Collections.IVectorView; - } - export interface ILanIdentifier { - infrastructureId: Windows.Networking.Connectivity.LanIdentifierData; - networkAdapterId: string; - portId: Windows.Networking.Connectivity.LanIdentifierData; - } - export class LanIdentifierData implements Windows.Networking.Connectivity.ILanIdentifierData { - type: number; - value: Windows.Foundation.Collections.IVectorView; - } - export interface NetworkStatusChangedEventHandler { - (sender: any): void; - } - export interface INetworkInformationStatics { - getConnectionProfiles(): Windows.Foundation.Collections.IVectorView; - getInternetConnectionProfile(): Windows.Networking.Connectivity.ConnectionProfile; - getLanIdentifiers(): Windows.Foundation.Collections.IVectorView; - getHostNames(): Windows.Foundation.Collections.IVectorView; - getProxyConfigurationAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation; - getSortedEndpointPairs(destinationList: Windows.Foundation.Collections.IIterable, sortOptions: Windows.Networking.HostNameSortOptions): Windows.Foundation.Collections.IVectorView; - onnetworkstatuschanged: any/* TODO */; - } - export class ConnectionProfile implements Windows.Networking.Connectivity.IConnectionProfile { - networkAdapter: Windows.Networking.Connectivity.NetworkAdapter; - networkSecuritySettings: Windows.Networking.Connectivity.NetworkSecuritySettings; - profileName: string; - getNetworkConnectivityLevel(): Windows.Networking.Connectivity.NetworkConnectivityLevel; - getNetworkNames(): Windows.Foundation.Collections.IVectorView; - getConnectionCost(): Windows.Networking.Connectivity.ConnectionCost; - getDataPlanStatus(): Windows.Networking.Connectivity.DataPlanStatus; - getLocalUsage(StartTime: Date, EndTime: Date): Windows.Networking.Connectivity.DataUsage; - getLocalUsage(StartTime: Date, EndTime: Date, States: Windows.Networking.Connectivity.RoamingStates): Windows.Networking.Connectivity.DataUsage; - } - export class LanIdentifier implements Windows.Networking.Connectivity.ILanIdentifier { - infrastructureId: Windows.Networking.Connectivity.LanIdentifierData; - networkAdapterId: string; - portId: Windows.Networking.Connectivity.LanIdentifierData; - } - export class ProxyConfiguration implements Windows.Networking.Connectivity.IProxyConfiguration { - canConnectDirectly: boolean; - proxyUris: Windows.Foundation.Collections.IVectorView; - } - export interface INetworkItem { - networkId: string; - getNetworkTypes(): Windows.Networking.Connectivity.NetworkTypes; - } - export interface INetworkAdapter { - ianaInterfaceType: number; - inboundMaxBitsPerSecond: number; - networkAdapterId: string; - networkItem: Windows.Networking.Connectivity.NetworkItem; - outboundMaxBitsPerSecond: number; - getConnectedProfileAsync(): Windows.Foundation.IAsyncOperation; - } - export class NetworkItem implements Windows.Networking.Connectivity.INetworkItem { - networkId: string; - getNetworkTypes(): Windows.Networking.Connectivity.NetworkTypes; - } - export interface IIPInformation { - networkAdapter: Windows.Networking.Connectivity.NetworkAdapter; - prefixLength: number; - } - export interface IProxyConfiguration { - canConnectDirectly: boolean; - proxyUris: Windows.Foundation.Collections.IVectorView; - } - export class NetworkInformation { - static getConnectionProfiles(): Windows.Foundation.Collections.IVectorView; - static getInternetConnectionProfile(): Windows.Networking.Connectivity.ConnectionProfile; - static getLanIdentifiers(): Windows.Foundation.Collections.IVectorView; - static getHostNames(): Windows.Foundation.Collections.IVectorView; - static getProxyConfigurationAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation; - static getSortedEndpointPairs(destinationList: Windows.Foundation.Collections.IIterable, sortOptions: Windows.Networking.HostNameSortOptions): Windows.Foundation.Collections.IVectorView; - static onnetworkstatuschanged: any/* TODO */; - } - } - } -} -declare module Windows { - export module Networking { - export module PushNotifications { - export enum PushNotificationType { - toast, - tile, - badge, - raw, - } - export interface IPushNotificationChannelManagerStatics { - createPushNotificationChannelForApplicationAsync(): Windows.Foundation.IAsyncOperation; - createPushNotificationChannelForApplicationAsync(applicationId: string): Windows.Foundation.IAsyncOperation; - createPushNotificationChannelForSecondaryTileAsync(tileId: string): Windows.Foundation.IAsyncOperation; - } - export class PushNotificationChannel implements Windows.Networking.PushNotifications.IPushNotificationChannel { - expirationTime: Date; - uri: string; - close(): void; - onpushnotificationreceived: any/* TODO */; - } - export interface IPushNotificationChannel { - expirationTime: Date; - uri: string; - close(): void; - onpushnotificationreceived: any/* TODO */; - } - export class PushNotificationReceivedEventArgs implements Windows.Networking.PushNotifications.IPushNotificationReceivedEventArgs { - badgeNotification: Windows.UI.Notifications.BadgeNotification; - cancel: boolean; - notificationType: Windows.Networking.PushNotifications.PushNotificationType; - rawNotification: Windows.Networking.PushNotifications.RawNotification; - tileNotification: Windows.UI.Notifications.TileNotification; - toastNotification: Windows.UI.Notifications.ToastNotification; - } - export interface IPushNotificationReceivedEventArgs { - badgeNotification: Windows.UI.Notifications.BadgeNotification; - cancel: boolean; - notificationType: Windows.Networking.PushNotifications.PushNotificationType; - rawNotification: Windows.Networking.PushNotifications.RawNotification; - tileNotification: Windows.UI.Notifications.TileNotification; - toastNotification: Windows.UI.Notifications.ToastNotification; - } - export class RawNotification implements Windows.Networking.PushNotifications.IRawNotification { - content: string; - } - export interface IRawNotification { - content: string; - } - export class PushNotificationChannelManager { - static createPushNotificationChannelForApplicationAsync(): Windows.Foundation.IAsyncOperation; - static createPushNotificationChannelForApplicationAsync(applicationId: string): Windows.Foundation.IAsyncOperation; - static createPushNotificationChannelForSecondaryTileAsync(tileId: string): Windows.Foundation.IAsyncOperation; - } - } - } -} -declare module Windows { - export module Security { - export module Authentication { - export module OnlineId { - export enum CredentialPromptType { - promptIfNeeded, - retypeCredentials, - doNotPrompt, - } - export interface IOnlineIdServiceTicketRequest { - policy: string; - service: string; - } - export interface IOnlineIdServiceTicketRequestFactory { - createOnlineIdServiceTicketRequest(service: string, policy: string): Windows.Security.Authentication.OnlineId.OnlineIdServiceTicketRequest; - createOnlineIdServiceTicketRequest(service: string): Windows.Security.Authentication.OnlineId.OnlineIdServiceTicketRequest; - } - export class OnlineIdServiceTicketRequest implements Windows.Security.Authentication.OnlineId.IOnlineIdServiceTicketRequest { - constructor(service: string, policy: string); - constructor(service: string); - policy: string; - service: string; - } - export interface IOnlineIdServiceTicket { - errorCode: number; - request: Windows.Security.Authentication.OnlineId.OnlineIdServiceTicketRequest; - value: string; - } - export interface IUserIdentity { - firstName: string; - id: string; - isBetaAccount: boolean; - isConfirmedPC: boolean; - lastName: string; - safeCustomerId: string; - signInName: string; - tickets: Windows.Foundation.Collections.IVectorView; - } - export class OnlineIdServiceTicket implements Windows.Security.Authentication.OnlineId.IOnlineIdServiceTicket { - errorCode: number; - request: Windows.Security.Authentication.OnlineId.OnlineIdServiceTicketRequest; - value: string; - } - export interface IOnlineIdAuthenticator { - applicationId: string; - authenticatedSafeCustomerId: string; - canSignOut: boolean; - authenticateUserAsync(request: Windows.Security.Authentication.OnlineId.OnlineIdServiceTicketRequest): Windows.Security.Authentication.OnlineId.UserAuthenticationOperation; - authenticateUserAsync(requests: Windows.Foundation.Collections.IIterable, credentialPromptType: Windows.Security.Authentication.OnlineId.CredentialPromptType): Windows.Security.Authentication.OnlineId.UserAuthenticationOperation; - signOutUserAsync(): Windows.Security.Authentication.OnlineId.SignOutUserOperation; - } - export class UserAuthenticationOperation implements Windows.Foundation.IAsyncOperation, Windows.Foundation.IAsyncInfo { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - errorCode: number; - id: number; - status: Windows.Foundation.AsyncStatus; - getResults(): Windows.Security.Authentication.OnlineId.UserIdentity; - cancel(): void; - close(): void; - then(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; - operation: { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - getResults(): Windows.Security.Authentication.OnlineId.UserIdentity; - } - } - export class SignOutUserOperation implements Windows.Foundation.IAsyncAction, Windows.Foundation.IAsyncInfo { - completed: Windows.Foundation.AsyncActionCompletedHandler; - errorCode: number; - id: number; - status: Windows.Foundation.AsyncStatus; - getResults(): void; - cancel(): void; - close(): void; - then(success: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success: (value: any) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success: (value: any) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; - operation: { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - getResults(): any; - } - } - export class UserIdentity implements Windows.Security.Authentication.OnlineId.IUserIdentity { - firstName: string; - id: string; - isBetaAccount: boolean; - isConfirmedPC: boolean; - lastName: string; - safeCustomerId: string; - signInName: string; - tickets: Windows.Foundation.Collections.IVectorView; - } - export class OnlineIdAuthenticator implements Windows.Security.Authentication.OnlineId.IOnlineIdAuthenticator { - applicationId: string; - authenticatedSafeCustomerId: string; - canSignOut: boolean; - authenticateUserAsync(request: Windows.Security.Authentication.OnlineId.OnlineIdServiceTicketRequest): Windows.Security.Authentication.OnlineId.UserAuthenticationOperation; - authenticateUserAsync(requests: Windows.Foundation.Collections.IIterable, credentialPromptType: Windows.Security.Authentication.OnlineId.CredentialPromptType): Windows.Security.Authentication.OnlineId.UserAuthenticationOperation; - signOutUserAsync(): Windows.Security.Authentication.OnlineId.SignOutUserOperation; - } - } - } - } -} -declare module Windows { - export module Security { - export module Authentication { - export module Web { - export enum WebAuthenticationStatus { - success, - userCancel, - errorHttp, - } - export enum WebAuthenticationOptions { - none, - silentMode, - useTitle, - useHttpPost, - useCorporateNetwork, - } - export interface IWebAuthenticationResult { - responseData: string; - responseErrorDetail: number; - responseStatus: Windows.Security.Authentication.Web.WebAuthenticationStatus; - } - export class WebAuthenticationResult implements Windows.Security.Authentication.Web.IWebAuthenticationResult { - responseData: string; - responseErrorDetail: number; - responseStatus: Windows.Security.Authentication.Web.WebAuthenticationStatus; - } - export interface IWebAuthenticationBrokerStatics { - authenticateAsync(options: Windows.Security.Authentication.Web.WebAuthenticationOptions, requestUri: Windows.Foundation.Uri, callbackUri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation; - authenticateAsync(options: Windows.Security.Authentication.Web.WebAuthenticationOptions, requestUri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation; - getCurrentApplicationCallbackUri(): Windows.Foundation.Uri; - } - export class WebAuthenticationBroker { - static authenticateAsync(options: Windows.Security.Authentication.Web.WebAuthenticationOptions, requestUri: Windows.Foundation.Uri, callbackUri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation; - static authenticateAsync(options: Windows.Security.Authentication.Web.WebAuthenticationOptions, requestUri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation; - static getCurrentApplicationCallbackUri(): Windows.Foundation.Uri; - } - } - } - } -} -declare module Windows { - export module Security { - export module Credentials { - export module UI { - export enum AuthenticationProtocol { - basic, - digest, - ntlm, - kerberos, - negotiate, - credSsp, - custom, - } - export enum CredentialSaveOption { - unselected, - selected, - hidden, - } - export interface ICredentialPickerOptions { - alwaysDisplayDialog: boolean; - authenticationProtocol: Windows.Security.Credentials.UI.AuthenticationProtocol; - callerSavesCredential: boolean; - caption: string; - credentialSaveOption: Windows.Security.Credentials.UI.CredentialSaveOption; - customAuthenticationProtocol: string; - errorCode: number; - message: string; - previousCredential: Windows.Storage.Streams.IBuffer; - targetName: string; - } - export class CredentialPickerOptions implements Windows.Security.Credentials.UI.ICredentialPickerOptions { - alwaysDisplayDialog: boolean; - authenticationProtocol: Windows.Security.Credentials.UI.AuthenticationProtocol; - callerSavesCredential: boolean; - caption: string; - credentialSaveOption: Windows.Security.Credentials.UI.CredentialSaveOption; - customAuthenticationProtocol: string; - errorCode: number; - message: string; - previousCredential: Windows.Storage.Streams.IBuffer; - targetName: string; - } - export interface ICredentialPickerStatics { - pickAsync(options: Windows.Security.Credentials.UI.CredentialPickerOptions): Windows.Foundation.IAsyncOperation; - pickAsync(targetName: string, message: string): Windows.Foundation.IAsyncOperation; - pickAsync(targetName: string, message: string, caption: string): Windows.Foundation.IAsyncOperation; - } - export class CredentialPickerResults implements Windows.Security.Credentials.UI.ICredentialPickerResults { - credential: Windows.Storage.Streams.IBuffer; - credentialDomainName: string; - credentialPassword: string; - credentialSaveOption: Windows.Security.Credentials.UI.CredentialSaveOption; - credentialSaved: boolean; - credentialUserName: string; - errorCode: number; - } - export class CredentialPicker { - static pickAsync(options: Windows.Security.Credentials.UI.CredentialPickerOptions): Windows.Foundation.IAsyncOperation; - static pickAsync(targetName: string, message: string): Windows.Foundation.IAsyncOperation; - static pickAsync(targetName: string, message: string, caption: string): Windows.Foundation.IAsyncOperation; - } - export interface ICredentialPickerResults { - credential: Windows.Storage.Streams.IBuffer; - credentialDomainName: string; - credentialPassword: string; - credentialSaveOption: Windows.Security.Credentials.UI.CredentialSaveOption; - credentialSaved: boolean; - credentialUserName: string; - errorCode: number; - } - } - } - } -} -declare module Windows { - export module Security { - export module Credentials { - export interface IPasswordCredential { - password: string; - properties: Windows.Foundation.Collections.IPropertySet; - resource: string; - userName: string; - retrievePassword(): void; - } - export class PasswordCredential implements Windows.Security.Credentials.IPasswordCredential { - constructor(resource: string, userName: string, password: string); - constructor(); - password: string; - properties: Windows.Foundation.Collections.IPropertySet; - resource: string; - userName: string; - retrievePassword(): void; - } - export interface ICredentialFactory { - createPasswordCredential(resource: string, userName: string, password: string): Windows.Security.Credentials.PasswordCredential; - } - export interface IPasswordVault { - add(credential: Windows.Security.Credentials.PasswordCredential): void; - remove(credential: Windows.Security.Credentials.PasswordCredential): void; - retrieve(resource: string, userName: string): Windows.Security.Credentials.PasswordCredential; - findAllByResource(resource: string): Windows.Foundation.Collections.IVectorView; - findAllByUserName(userName: string): Windows.Foundation.Collections.IVectorView; - retrieveAll(): Windows.Foundation.Collections.IVectorView; - } - export class PasswordVault implements Windows.Security.Credentials.IPasswordVault { - add(credential: Windows.Security.Credentials.PasswordCredential): void; - remove(credential: Windows.Security.Credentials.PasswordCredential): void; - retrieve(resource: string, userName: string): Windows.Security.Credentials.PasswordCredential; - findAllByResource(resource: string): Windows.Foundation.Collections.IVectorView; - findAllByUserName(userName: string): Windows.Foundation.Collections.IVectorView; - retrieveAll(): Windows.Foundation.Collections.IVectorView; - } - export class PasswordCredentialPropertyStore implements Windows.Foundation.Collections.IPropertySet, Windows.Foundation.Collections.IObservableMap, Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { - size: number; - onmapchanged: any/* TODO */; - lookup(key: string): any; - hasKey(key: string): boolean; - getView(): Windows.Foundation.Collections.IMapView; - insert(key: string, value: any): boolean; - remove(key: string): void; - clear(): void; - first(): Windows.Foundation.Collections.IIterator>; - } - } - } -} -declare module Windows { - export module Security { - export module Cryptography { - export module Certificates { - export enum EnrollKeyUsages { - none, - decryption, - signing, - keyAgreement, - all, - } - export enum KeyProtectionLevel { - noConsent, - consentOnly, - consentWithPassword, - } - export enum ExportOption { - notExportable, - exportable, - } - export enum KeySize { - invalid, - rsa2048, - rsa4096, - } - export enum InstallOptions { - none, - deleteExpired, - } - export interface ICertificateRequestProperties { - exportable: Windows.Security.Cryptography.Certificates.ExportOption; - friendlyName: string; - hashAlgorithmName: string; - keyAlgorithmName: string; - keyProtectionLevel: Windows.Security.Cryptography.Certificates.KeyProtectionLevel; - keySize: number; - keyStorageProviderName: string; - keyUsages: Windows.Security.Cryptography.Certificates.EnrollKeyUsages; - subject: string; - } - export class CertificateRequestProperties implements Windows.Security.Cryptography.Certificates.ICertificateRequestProperties { - exportable: Windows.Security.Cryptography.Certificates.ExportOption; - friendlyName: string; - hashAlgorithmName: string; - keyAlgorithmName: string; - keyProtectionLevel: Windows.Security.Cryptography.Certificates.KeyProtectionLevel; - keySize: number; - keyStorageProviderName: string; - keyUsages: Windows.Security.Cryptography.Certificates.EnrollKeyUsages; - subject: string; - } - export interface ICertificateEnrollmentManagerStatics { - createRequestAsync(request: Windows.Security.Cryptography.Certificates.CertificateRequestProperties): Windows.Foundation.IAsyncOperation; - installCertificateAsync(certificate: string, installOption: Windows.Security.Cryptography.Certificates.InstallOptions): Windows.Foundation.IAsyncAction; - importPfxDataAsync(pfxData: string, password: string, exportable: Windows.Security.Cryptography.Certificates.ExportOption, keyProtectionLevel: Windows.Security.Cryptography.Certificates.KeyProtectionLevel, installOption: Windows.Security.Cryptography.Certificates.InstallOptions, friendlyName: string): Windows.Foundation.IAsyncAction; - } - export class CertificateEnrollmentManager { - static createRequestAsync(request: Windows.Security.Cryptography.Certificates.CertificateRequestProperties): Windows.Foundation.IAsyncOperation; - static installCertificateAsync(certificate: string, installOption: Windows.Security.Cryptography.Certificates.InstallOptions): Windows.Foundation.IAsyncAction; - static importPfxDataAsync(pfxData: string, password: string, exportable: Windows.Security.Cryptography.Certificates.ExportOption, keyProtectionLevel: Windows.Security.Cryptography.Certificates.KeyProtectionLevel, installOption: Windows.Security.Cryptography.Certificates.InstallOptions, friendlyName: string): Windows.Foundation.IAsyncAction; - } - export interface IKeyAlgorithmNamesStatics { - dsa: string; - ecdh256: string; - ecdh384: string; - ecdh521: string; - ecdsa256: string; - ecdsa384: string; - ecdsa521: string; - rsa: string; - } - export class KeyAlgorithmNames { - static dsa: string; - static ecdh256: string; - static ecdh384: string; - static ecdh521: string; - static ecdsa256: string; - static ecdsa384: string; - static ecdsa521: string; - static rsa: string; - } - export interface IKeyStorageProviderNamesStatics { - platformKeyStorageProvider: string; - smartcardKeyStorageProvider: string; - softwareKeyStorageProvider: string; - } - export class KeyStorageProviderNames { - static platformKeyStorageProvider: string; - static smartcardKeyStorageProvider: string; - static softwareKeyStorageProvider: string; - } - } - } - } -} -declare module Windows { - export module Security { - export module Cryptography { - export module Core { - export enum CryptographicPrivateKeyBlobType { - pkcs8RawPrivateKeyInfo, - pkcs1RsaPrivateKey, - bCryptPrivateKey, - capi1PrivateKey, - } - export enum CryptographicPublicKeyBlobType { - x509SubjectPublicKeyInfo, - pkcs1RsaPublicKey, - bCryptPublicKey, - capi1PublicKey, - } - export interface IKeyDerivationParameters { - iterationCount: number; - kdfGenericBinary: Windows.Storage.Streams.IBuffer; - } - export interface IKeyDerivationParametersStatics { - buildForPbkdf2(pbkdf2Salt: Windows.Storage.Streams.IBuffer, iterationCount: number): Windows.Security.Cryptography.Core.KeyDerivationParameters; - buildForSP800108(label: Windows.Storage.Streams.IBuffer, context: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.KeyDerivationParameters; - 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; - } - export class KeyDerivationParameters implements Windows.Security.Cryptography.Core.IKeyDerivationParameters { - iterationCount: number; - kdfGenericBinary: Windows.Storage.Streams.IBuffer; - static buildForPbkdf2(pbkdf2Salt: Windows.Storage.Streams.IBuffer, iterationCount: number): Windows.Security.Cryptography.Core.KeyDerivationParameters; - static buildForSP800108(label: Windows.Storage.Streams.IBuffer, context: Windows.Storage.Streams.IBuffer): 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; - } - export interface ICryptographicKey { - keySize: number; - export(): Windows.Storage.Streams.IBuffer; - export(BlobType: Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType): Windows.Storage.Streams.IBuffer; - exportPublicKey(): Windows.Storage.Streams.IBuffer; - exportPublicKey(BlobType: Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType): Windows.Storage.Streams.IBuffer; - } - export class CryptographicKey implements Windows.Security.Cryptography.Core.ICryptographicKey { - keySize: number; - export(): Windows.Storage.Streams.IBuffer; - export(BlobType: Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType): Windows.Storage.Streams.IBuffer; - exportPublicKey(): Windows.Storage.Streams.IBuffer; - exportPublicKey(BlobType: Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType): Windows.Storage.Streams.IBuffer; - } - export interface IHashComputation { - append(data: Windows.Storage.Streams.IBuffer): void; - getValueAndReset(): Windows.Storage.Streams.IBuffer; - } - export class CryptographicHash implements Windows.Security.Cryptography.Core.IHashComputation { - append(data: Windows.Storage.Streams.IBuffer): void; - getValueAndReset(): Windows.Storage.Streams.IBuffer; - } - export interface IHashAlgorithmProvider { - algorithmName: string; - hashLength: number; - hashData(data: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; - createHash(): Windows.Security.Cryptography.Core.CryptographicHash; - } - export interface IMacAlgorithmProvider { - algorithmName: string; - macLength: number; - createKey(keyMaterial: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; - } - export interface IKeyDerivationAlgorithmProvider { - algorithmName: string; - createKey(keyMaterial: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; - } - export interface ISymmetricKeyAlgorithmProvider { - algorithmName: string; - blockLength: number; - createSymmetricKey(keyMaterial: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; - } - export interface IAsymmetricKeyAlgorithmProvider { - algorithmName: string; - createKeyPair(keySize: number): Windows.Security.Cryptography.Core.CryptographicKey; - importKeyPair(keyBlob: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; - importKeyPair(keyBlob: Windows.Storage.Streams.IBuffer, BlobType: Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType): Windows.Security.Cryptography.Core.CryptographicKey; - importPublicKey(keyBlob: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; - importPublicKey(keyBlob: Windows.Storage.Streams.IBuffer, BlobType: Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType): Windows.Security.Cryptography.Core.CryptographicKey; - } - export interface IEncryptedAndAuthenticatedData { - authenticationTag: Windows.Storage.Streams.IBuffer; - encryptedData: Windows.Storage.Streams.IBuffer; - } - export class EncryptedAndAuthenticatedData implements Windows.Security.Cryptography.Core.IEncryptedAndAuthenticatedData { - authenticationTag: Windows.Storage.Streams.IBuffer; - encryptedData: Windows.Storage.Streams.IBuffer; - } - export interface ICryptographicEngineStatics { - encrypt(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer, iv: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; - decrypt(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer, iv: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; - 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; - 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; - sign(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; - verifySignature(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer, signature: Windows.Storage.Streams.IBuffer): boolean; - deriveKeyMaterial(key: Windows.Security.Cryptography.Core.CryptographicKey, parameters: Windows.Security.Cryptography.Core.KeyDerivationParameters, desiredKeySize: number): Windows.Storage.Streams.IBuffer; - } - export class CryptographicEngine { - static encrypt(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer, iv: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; - static decrypt(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer, iv: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; - 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; - 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; - static sign(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; - static verifySignature(key: Windows.Security.Cryptography.Core.CryptographicKey, data: Windows.Storage.Streams.IBuffer, signature: Windows.Storage.Streams.IBuffer): boolean; - static deriveKeyMaterial(key: Windows.Security.Cryptography.Core.CryptographicKey, parameters: Windows.Security.Cryptography.Core.KeyDerivationParameters, desiredKeySize: number): Windows.Storage.Streams.IBuffer; - } - export interface IHashAlgorithmProviderStatics { - openAlgorithm(algorithm: string): Windows.Security.Cryptography.Core.HashAlgorithmProvider; - } - export class HashAlgorithmProvider implements Windows.Security.Cryptography.Core.IHashAlgorithmProvider { - algorithmName: string; - hashLength: number; - hashData(data: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.IBuffer; - createHash(): Windows.Security.Cryptography.Core.CryptographicHash; - static openAlgorithm(algorithm: string): Windows.Security.Cryptography.Core.HashAlgorithmProvider; - } - export interface IMacAlgorithmProviderStatics { - openAlgorithm(algorithm: string): Windows.Security.Cryptography.Core.MacAlgorithmProvider; - } - export class MacAlgorithmProvider implements Windows.Security.Cryptography.Core.IMacAlgorithmProvider { - algorithmName: string; - macLength: number; - createKey(keyMaterial: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; - static openAlgorithm(algorithm: string): Windows.Security.Cryptography.Core.MacAlgorithmProvider; - } - export interface IKeyDerivationAlgorithmProviderStatics { - openAlgorithm(algorithm: string): Windows.Security.Cryptography.Core.KeyDerivationAlgorithmProvider; - } - export class KeyDerivationAlgorithmProvider implements Windows.Security.Cryptography.Core.IKeyDerivationAlgorithmProvider { - algorithmName: string; - createKey(keyMaterial: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; - static openAlgorithm(algorithm: string): Windows.Security.Cryptography.Core.KeyDerivationAlgorithmProvider; - } - export interface ISymmetricKeyAlgorithmProviderStatics { - openAlgorithm(algorithm: string): Windows.Security.Cryptography.Core.SymmetricKeyAlgorithmProvider; - } - export class SymmetricKeyAlgorithmProvider implements Windows.Security.Cryptography.Core.ISymmetricKeyAlgorithmProvider { - algorithmName: string; - blockLength: number; - createSymmetricKey(keyMaterial: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; - static openAlgorithm(algorithm: string): Windows.Security.Cryptography.Core.SymmetricKeyAlgorithmProvider; - } - export interface IAsymmetricKeyAlgorithmProviderStatics { - openAlgorithm(algorithm: string): Windows.Security.Cryptography.Core.AsymmetricKeyAlgorithmProvider; - } - export class AsymmetricKeyAlgorithmProvider implements Windows.Security.Cryptography.Core.IAsymmetricKeyAlgorithmProvider { - algorithmName: string; - createKeyPair(keySize: number): Windows.Security.Cryptography.Core.CryptographicKey; - importKeyPair(keyBlob: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; - importKeyPair(keyBlob: Windows.Storage.Streams.IBuffer, BlobType: Windows.Security.Cryptography.Core.CryptographicPrivateKeyBlobType): Windows.Security.Cryptography.Core.CryptographicKey; - importPublicKey(keyBlob: Windows.Storage.Streams.IBuffer): Windows.Security.Cryptography.Core.CryptographicKey; - importPublicKey(keyBlob: Windows.Storage.Streams.IBuffer, BlobType: Windows.Security.Cryptography.Core.CryptographicPublicKeyBlobType): Windows.Security.Cryptography.Core.CryptographicKey; - static openAlgorithm(algorithm: string): Windows.Security.Cryptography.Core.AsymmetricKeyAlgorithmProvider; - } - export interface IHashAlgorithmNamesStatics { - md5: string; - sha1: string; - sha256: string; - sha384: string; - sha512: string; - } - export class HashAlgorithmNames { - static md5: string; - static sha1: string; - static sha256: string; - static sha384: string; - static sha512: string; - } - export interface IMacAlgorithmNamesStatics { - aesCmac: string; - hmacMd5: string; - hmacSha1: string; - hmacSha256: string; - hmacSha384: string; - hmacSha512: string; - } - export class MacAlgorithmNames { - static aesCmac: string; - static hmacMd5: string; - static hmacSha1: string; - static hmacSha256: string; - static hmacSha384: string; - static hmacSha512: string; - } - export interface ISymmetricAlgorithmNamesStatics { - aesCbc: string; - aesCbcPkcs7: string; - aesCcm: string; - aesEcb: string; - aesEcbPkcs7: string; - aesGcm: string; - desCbc: string; - desCbcPkcs7: string; - desEcb: string; - desEcbPkcs7: string; - rc2Cbc: string; - rc2CbcPkcs7: string; - rc2Ecb: string; - rc2EcbPkcs7: string; - rc4: string; - tripleDesCbc: string; - tripleDesCbcPkcs7: string; - tripleDesEcb: string; - tripleDesEcbPkcs7: string; - } - export class SymmetricAlgorithmNames { - static aesCbc: string; - static aesCbcPkcs7: string; - static aesCcm: string; - static aesEcb: string; - static aesEcbPkcs7: string; - static aesGcm: string; - static desCbc: string; - static desCbcPkcs7: string; - static desEcb: string; - static desEcbPkcs7: string; - static rc2Cbc: string; - static rc2CbcPkcs7: string; - static rc2Ecb: string; - static rc2EcbPkcs7: string; - static rc4: string; - static tripleDesCbc: string; - static tripleDesCbcPkcs7: string; - static tripleDesEcb: string; - static tripleDesEcbPkcs7: string; - } - export interface IAsymmetricAlgorithmNamesStatics { - dsaSha1: string; - dsaSha256: string; - ecdsaP256Sha256: string; - ecdsaP384Sha384: string; - ecdsaP521Sha512: string; - rsaOaepSha1: string; - rsaOaepSha256: string; - rsaOaepSha384: string; - rsaOaepSha512: string; - rsaPkcs1: string; - rsaSignPkcs1Sha1: string; - rsaSignPkcs1Sha256: string; - rsaSignPkcs1Sha384: string; - rsaSignPkcs1Sha512: string; - rsaSignPssSha1: string; - rsaSignPssSha256: string; - rsaSignPssSha384: string; - rsaSignPssSha512: string; - } - export class AsymmetricAlgorithmNames { - static dsaSha1: string; - static dsaSha256: string; - static ecdsaP256Sha256: string; - static ecdsaP384Sha384: string; - static ecdsaP521Sha512: string; - static rsaOaepSha1: string; - static rsaOaepSha256: string; - static rsaOaepSha384: string; - static rsaOaepSha512: string; - static rsaPkcs1: string; - static rsaSignPkcs1Sha1: string; - static rsaSignPkcs1Sha256: string; - static rsaSignPkcs1Sha384: string; - static rsaSignPkcs1Sha512: string; - static rsaSignPssSha1: string; - static rsaSignPssSha256: string; - static rsaSignPssSha384: string; - static rsaSignPssSha512: string; - } - export interface IKeyDerivationAlgorithmNamesStatics { - pbkdf2Md5: string; - pbkdf2Sha1: string; - pbkdf2Sha256: string; - pbkdf2Sha384: string; - pbkdf2Sha512: string; - sp800108CtrHmacMd5: string; - sp800108CtrHmacSha1: string; - sp800108CtrHmacSha256: string; - sp800108CtrHmacSha384: string; - sp800108CtrHmacSha512: string; - sp80056aConcatMd5: string; - sp80056aConcatSha1: string; - sp80056aConcatSha256: string; - sp80056aConcatSha384: string; - sp80056aConcatSha512: string; - } - export class KeyDerivationAlgorithmNames { - static pbkdf2Md5: string; - static pbkdf2Sha1: string; - static pbkdf2Sha256: string; - static pbkdf2Sha384: string; - static pbkdf2Sha512: string; - static sp800108CtrHmacMd5: string; - static sp800108CtrHmacSha1: string; - static sp800108CtrHmacSha256: string; - static sp800108CtrHmacSha384: string; - static sp800108CtrHmacSha512: string; - static sp80056aConcatMd5: string; - static sp80056aConcatSha1: string; - static sp80056aConcatSha256: string; - static sp80056aConcatSha384: string; - static sp80056aConcatSha512: string; - } - } - } - } -} -declare module Windows { - export module Security { - export module Cryptography { - export module DataProtection { - export interface IDataProtectionProvider { - protectAsync(data: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperation; - unprotectAsync(data: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperation; - protectStreamAsync(src: Windows.Storage.Streams.IInputStream, dest: Windows.Storage.Streams.IOutputStream): Windows.Foundation.IAsyncAction; - unprotectStreamAsync(src: Windows.Storage.Streams.IInputStream, dest: Windows.Storage.Streams.IOutputStream): Windows.Foundation.IAsyncAction; - } - export interface IDataProtectionProviderFactory { - createOverloadExplicit(protectionDescriptor: string): Windows.Security.Cryptography.DataProtection.DataProtectionProvider; - } - export class DataProtectionProvider implements Windows.Security.Cryptography.DataProtection.IDataProtectionProvider { - constructor(protectionDescriptor: string); - constructor(); - protectAsync(data: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperation; - unprotectAsync(data: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperation; - protectStreamAsync(src: Windows.Storage.Streams.IInputStream, dest: Windows.Storage.Streams.IOutputStream): Windows.Foundation.IAsyncAction; - unprotectStreamAsync(src: Windows.Storage.Streams.IInputStream, dest: Windows.Storage.Streams.IOutputStream): Windows.Foundation.IAsyncAction; - } - } - } - } -} -declare module Windows { - export module Security { - export module Cryptography { - export enum BinaryStringEncoding { - utf8, - utf16LE, - utf16BE, - } - export interface ICryptographicBufferStatics { - compare(object1: Windows.Storage.Streams.IBuffer, object2: Windows.Storage.Streams.IBuffer): boolean; - generateRandom(length: number): Windows.Storage.Streams.IBuffer; - generateRandomNumber(): number; - createFromByteArray(value: Uint8Array): Windows.Storage.Streams.IBuffer; - copyToByteArray(buffer: Windows.Storage.Streams.IBuffer): Uint8Array; - decodeFromHexString(value: string): Windows.Storage.Streams.IBuffer; - encodeToHexString(buffer: Windows.Storage.Streams.IBuffer): string; - decodeFromBase64String(value: string): Windows.Storage.Streams.IBuffer; - encodeToBase64String(buffer: Windows.Storage.Streams.IBuffer): string; - convertStringToBinary(value: string, encoding: Windows.Security.Cryptography.BinaryStringEncoding): Windows.Storage.Streams.IBuffer; - convertBinaryToString(encoding: Windows.Security.Cryptography.BinaryStringEncoding, buffer: Windows.Storage.Streams.IBuffer): string; - } - export class CryptographicBuffer { - static compare(object1: Windows.Storage.Streams.IBuffer, object2: Windows.Storage.Streams.IBuffer): boolean; - static generateRandom(length: number): Windows.Storage.Streams.IBuffer; - static generateRandomNumber(): number; - static createFromByteArray(value: Uint8Array): Windows.Storage.Streams.IBuffer; - static copyToByteArray(buffer: Windows.Storage.Streams.IBuffer): Uint8Array; - static decodeFromHexString(value: string): Windows.Storage.Streams.IBuffer; - static encodeToHexString(buffer: Windows.Storage.Streams.IBuffer): string; - static decodeFromBase64String(value: string): Windows.Storage.Streams.IBuffer; - static encodeToBase64String(buffer: Windows.Storage.Streams.IBuffer): string; - static convertStringToBinary(value: string, encoding: Windows.Security.Cryptography.BinaryStringEncoding): Windows.Storage.Streams.IBuffer; - static convertBinaryToString(encoding: Windows.Security.Cryptography.BinaryStringEncoding, buffer: Windows.Storage.Streams.IBuffer): string; - } - } - } -} -declare module Windows { - export module Security { - export module ExchangeActiveSyncProvisioning { - export enum EasRequireEncryptionResult { - notEvaluated, - compliant, - canBeCompliant, - notProvisionedOnAllVolumes, - deFixedDataNotSupported, - deHardwareNotCompliant, - deWinReNotConfigured, - deProtectionSuspended, - deOsVolumeNotProtected, - deProtectionNotYetEnabled, - noFeatureLicense, - osNotProtected, - } - export enum EasMinPasswordLengthResult { - notEvaluated, - compliant, - canBeCompliant, - requestedPolicyIsStricter, - requestedPolicyNotEnforceable, - invalidParameter, - currentUserHasBlankPassword, - adminsHaveBlankPassword, - userCannotChangePassword, - adminsCannotChangePassword, - localControlledUsersCannotChangePassword, - connectedAdminsProviderPolicyIsWeak, - connectedUserProviderPolicyIsWeak, - changeConnectedAdminsPassword, - changeConnectedUserPassword, - } - export enum EasDisallowConvenienceLogonResult { - notEvaluated, - compliant, - canBeCompliant, - requestedPolicyIsStricter, - } - export enum EasMinPasswordComplexCharactersResult { - notEvaluated, - compliant, - canBeCompliant, - requestedPolicyIsStricter, - requestedPolicyNotEnforceable, - invalidParameter, - currentUserHasBlankPassword, - adminsHaveBlankPassword, - userCannotChangePassword, - adminsCannotChangePassword, - localControlledUsersCannotChangePassword, - connectedAdminsProviderPolicyIsWeak, - connectedUserProviderPolicyIsWeak, - changeConnectedAdminsPassword, - changeConnectedUserPassword, - } - export enum EasPasswordExpirationResult { - notEvaluated, - compliant, - canBeCompliant, - requestedPolicyIsStricter, - requestedExpirationIncompatible, - invalidParameter, - userCannotChangePassword, - adminsCannotChangePassword, - localControlledUsersCannotChangePassword, - } - export enum EasPasswordHistoryResult { - notEvaluated, - compliant, - canBeCompliant, - requestedPolicyIsStricter, - invalidParameter, - } - export enum EasMaxPasswordFailedAttemptsResult { - notEvaluated, - compliant, - canBeCompliant, - requestedPolicyIsStricter, - invalidParameter, - } - export enum EasMaxInactivityTimeLockResult { - notEvaluated, - compliant, - canBeCompliant, - requestedPolicyIsStricter, - invalidParameter, - } - export interface IEasClientDeviceInformation { - friendlyName: string; - id: string; - operatingSystem: string; - systemManufacturer: string; - systemProductName: string; - systemSku: string; - } - export interface IEasClientSecurityPolicy { - disallowConvenienceLogon: boolean; - maxInactivityTimeLock: number; - maxPasswordFailedAttempts: number; - minPasswordComplexCharacters: number; - minPasswordLength: number; - passwordExpiration: number; - passwordHistory: number; - requireEncryption: boolean; - checkCompliance(): Windows.Security.ExchangeActiveSyncProvisioning.EasComplianceResults; - applyAsync(): Windows.Foundation.IAsyncOperation; - } - export class EasComplianceResults implements Windows.Security.ExchangeActiveSyncProvisioning.IEasComplianceResults { - compliant: boolean; - disallowConvenienceLogonResult: Windows.Security.ExchangeActiveSyncProvisioning.EasDisallowConvenienceLogonResult; - maxInactivityTimeLockResult: Windows.Security.ExchangeActiveSyncProvisioning.EasMaxInactivityTimeLockResult; - maxPasswordFailedAttemptsResult: Windows.Security.ExchangeActiveSyncProvisioning.EasMaxPasswordFailedAttemptsResult; - minPasswordComplexCharactersResult: Windows.Security.ExchangeActiveSyncProvisioning.EasMinPasswordComplexCharactersResult; - minPasswordLengthResult: Windows.Security.ExchangeActiveSyncProvisioning.EasMinPasswordLengthResult; - passwordExpirationResult: Windows.Security.ExchangeActiveSyncProvisioning.EasPasswordExpirationResult; - passwordHistoryResult: Windows.Security.ExchangeActiveSyncProvisioning.EasPasswordHistoryResult; - requireEncryptionResult: Windows.Security.ExchangeActiveSyncProvisioning.EasRequireEncryptionResult; - } - export interface IEasComplianceResults { - compliant: boolean; - disallowConvenienceLogonResult: Windows.Security.ExchangeActiveSyncProvisioning.EasDisallowConvenienceLogonResult; - maxInactivityTimeLockResult: Windows.Security.ExchangeActiveSyncProvisioning.EasMaxInactivityTimeLockResult; - maxPasswordFailedAttemptsResult: Windows.Security.ExchangeActiveSyncProvisioning.EasMaxPasswordFailedAttemptsResult; - minPasswordComplexCharactersResult: Windows.Security.ExchangeActiveSyncProvisioning.EasMinPasswordComplexCharactersResult; - minPasswordLengthResult: Windows.Security.ExchangeActiveSyncProvisioning.EasMinPasswordLengthResult; - passwordExpirationResult: Windows.Security.ExchangeActiveSyncProvisioning.EasPasswordExpirationResult; - passwordHistoryResult: Windows.Security.ExchangeActiveSyncProvisioning.EasPasswordHistoryResult; - requireEncryptionResult: Windows.Security.ExchangeActiveSyncProvisioning.EasRequireEncryptionResult; - } - export class EasClientSecurityPolicy implements Windows.Security.ExchangeActiveSyncProvisioning.IEasClientSecurityPolicy { - disallowConvenienceLogon: boolean; - maxInactivityTimeLock: number; - maxPasswordFailedAttempts: number; - minPasswordComplexCharacters: number; - minPasswordLength: number; - passwordExpiration: number; - passwordHistory: number; - requireEncryption: boolean; - checkCompliance(): Windows.Security.ExchangeActiveSyncProvisioning.EasComplianceResults; - applyAsync(): Windows.Foundation.IAsyncOperation; - } - export class EasClientDeviceInformation implements Windows.Security.ExchangeActiveSyncProvisioning.IEasClientDeviceInformation { - friendlyName: string; - id: string; - operatingSystem: string; - systemManufacturer: string; - systemProductName: string; - systemSku: string; - } - } - } -} -declare module Windows { - export module Storage { - export module Streams { - export enum ByteOrder { - littleEndian, - bigEndian, - } - export enum UnicodeEncoding { - utf8, - utf16LE, - utf16BE, - } - export class DataReaderLoadOperation implements Windows.Foundation.IAsyncOperation, Windows.Foundation.IAsyncInfo { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - errorCode: number; - id: number; - status: Windows.Foundation.AsyncStatus; - getResults(): number; - cancel(): void; - close(): void; - then(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: number) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: number) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; - operation: { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - getResults(): number; - } - } - export interface IDataReader { - byteOrder: Windows.Storage.Streams.ByteOrder; - inputStreamOptions: Windows.Storage.Streams.InputStreamOptions; - unconsumedBufferLength: number; - unicodeEncoding: Windows.Storage.Streams.UnicodeEncoding; - readByte(): number; - readBytes(): Uint8Array; - readBuffer(length: number): Windows.Storage.Streams.IBuffer; - readBoolean(): boolean; - readGuid(): string; - readInt16(): number; - readInt32(): number; - readInt64(): number; - readUInt16(): number; - readUInt32(): number; - readUInt64(): number; - readSingle(): number; - readDouble(): number; - readString(codeUnitCount: number): string; - readDateTime(): Date; - readTimeSpan(): number; - loadAsync(count: number): Windows.Storage.Streams.DataReaderLoadOperation; - detachBuffer(): Windows.Storage.Streams.IBuffer; - detachStream(): Windows.Storage.Streams.IInputStream; - } - export interface IDataReaderFactory { - createDataReader(inputStream: Windows.Storage.Streams.IInputStream): Windows.Storage.Streams.DataReader; - } - export class DataReader implements Windows.Storage.Streams.IDataReader, Windows.Foundation.IClosable { - constructor(inputStream: Windows.Storage.Streams.IInputStream); - byteOrder: Windows.Storage.Streams.ByteOrder; - inputStreamOptions: Windows.Storage.Streams.InputStreamOptions; - unconsumedBufferLength: number; - unicodeEncoding: Windows.Storage.Streams.UnicodeEncoding; - readByte(): number; - readBytes(): Uint8Array; - readBuffer(length: number): Windows.Storage.Streams.IBuffer; - readBoolean(): boolean; - readGuid(): string; - readInt16(): number; - readInt32(): number; - readInt64(): number; - readUInt16(): number; - readUInt32(): number; - readUInt64(): number; - readSingle(): number; - readDouble(): number; - readString(codeUnitCount: number): string; - readDateTime(): Date; - readTimeSpan(): number; - loadAsync(count: number): Windows.Storage.Streams.DataReaderLoadOperation; - detachBuffer(): Windows.Storage.Streams.IBuffer; - detachStream(): Windows.Storage.Streams.IInputStream; - dispose(): void; - static fromBuffer(buffer: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.DataReader; - close(): void; - } - export interface IDataReaderStatics { - fromBuffer(buffer: Windows.Storage.Streams.IBuffer): Windows.Storage.Streams.DataReader; - } - export class DataWriterStoreOperation implements Windows.Foundation.IAsyncOperation, Windows.Foundation.IAsyncInfo { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - errorCode: number; - id: number; - status: Windows.Foundation.AsyncStatus; - getResults(): number; - cancel(): void; - close(): void; - then(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: number) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: number) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; - operation: { - completed: Windows.Foundation.AsyncOperationCompletedHandler; - getResults(): number; - } - } - export interface IDataWriter { - byteOrder: Windows.Storage.Streams.ByteOrder; - unicodeEncoding: Windows.Storage.Streams.UnicodeEncoding; - unstoredBufferLength: number; - writeByte(value: number): void; - writeBytes(value: Uint8Array): void; - writeBuffer(buffer: Windows.Storage.Streams.IBuffer): void; - writeBuffer(buffer: Windows.Storage.Streams.IBuffer, start: number, count: number): void; - writeBoolean(value: boolean): void; - writeGuid(value: string): void; - writeInt16(value: number): void; - writeInt32(value: number): void; - writeInt64(value: number): void; - writeUInt16(value: number): void; - writeUInt32(value: number): void; - writeUInt64(value: number): void; - writeSingle(value: number): void; - writeDouble(value: number): void; - writeDateTime(value: Date): void; - writeTimeSpan(value: number): void; - writeString(value: string): number; - measureString(value: string): number; - storeAsync(): Windows.Storage.Streams.DataWriterStoreOperation; - flushAsync(): Windows.Foundation.IAsyncOperation; - detachBuffer(): Windows.Storage.Streams.IBuffer; - detachStream(): Windows.Storage.Streams.IOutputStream; - } - export interface IDataWriterFactory { - createDataWriter(outputStream: Windows.Storage.Streams.IOutputStream): Windows.Storage.Streams.DataWriter; - } - export class DataWriter implements Windows.Storage.Streams.IDataWriter, Windows.Foundation.IClosable { - constructor(outputStream: Windows.Storage.Streams.IOutputStream); - constructor(); - byteOrder: Windows.Storage.Streams.ByteOrder; - unicodeEncoding: Windows.Storage.Streams.UnicodeEncoding; - unstoredBufferLength: number; - writeByte(value: number): void; - writeBytes(value: Uint8Array): void; - writeBuffer(buffer: Windows.Storage.Streams.IBuffer): void; - writeBuffer(buffer: Windows.Storage.Streams.IBuffer, start: number, count: number): void; - writeBoolean(value: boolean): void; - writeGuid(value: string): void; - writeInt16(value: number): void; - writeInt32(value: number): void; - writeInt64(value: number): void; - writeUInt16(value: number): void; - writeUInt32(value: number): void; - writeUInt64(value: number): void; - writeSingle(value: number): void; - writeDouble(value: number): void; - writeDateTime(value: Date): void; - writeTimeSpan(value: number): void; - writeString(value: string): number; - measureString(value: string): number; - storeAsync(): Windows.Storage.Streams.DataWriterStoreOperation; - flushAsync(): Windows.Foundation.IAsyncOperation; - detachBuffer(): Windows.Storage.Streams.IBuffer; - detachStream(): Windows.Storage.Streams.IOutputStream; - dispose(): void; - close(): void; - } - export interface IRandomAccessStreamStatics { - copyAsync(source: Windows.Storage.Streams.IInputStream, destination: Windows.Storage.Streams.IOutputStream): Windows.Foundation.IAsyncOperationWithProgress; - copyAsync(source: Windows.Storage.Streams.IInputStream, destination: Windows.Storage.Streams.IOutputStream, bytesToCopy: number): Windows.Foundation.IAsyncOperationWithProgress; - copyAndCloseAsync(source: Windows.Storage.Streams.IInputStream, destination: Windows.Storage.Streams.IOutputStream): Windows.Foundation.IAsyncOperationWithProgress; - } - export class RandomAccessStream { - static copyAsync(source: Windows.Storage.Streams.IInputStream, destination: Windows.Storage.Streams.IOutputStream): Windows.Foundation.IAsyncOperationWithProgress; - static copyAsync(source: Windows.Storage.Streams.IInputStream, destination: Windows.Storage.Streams.IOutputStream, bytesToCopy: number): Windows.Foundation.IAsyncOperationWithProgress; - static copyAndCloseAsync(source: Windows.Storage.Streams.IInputStream, destination: Windows.Storage.Streams.IOutputStream): Windows.Foundation.IAsyncOperationWithProgress; - } - export interface IBufferFactory { - create(capacity: number): Windows.Storage.Streams.Buffer; - } - export class Buffer implements Windows.Storage.Streams.IBuffer { - constructor(capacity: number); - capacity: number; - length: number; - } - export interface IBuffer { - capacity: number; - length: number; - } - export enum InputStreamOptions { - none, - partial, - readAhead, - } - export interface IContentTypeProvider { - contentType: string; - } - export interface IRandomAccessStreamReference { - openReadAsync(): Windows.Foundation.IAsyncOperation; - } - export interface IInputStreamReference { - openSequentialReadAsync(): Windows.Foundation.IAsyncOperation; - } - export interface IRandomAccessStreamReferenceStatics { - createFromFile(file: Windows.Storage.IStorageFile): Windows.Storage.Streams.RandomAccessStreamReference; - createFromUri(uri: Windows.Foundation.Uri): Windows.Storage.Streams.RandomAccessStreamReference; - createFromStream(stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Storage.Streams.RandomAccessStreamReference; - } - export class RandomAccessStreamReference implements Windows.Storage.Streams.IRandomAccessStreamReference { - openReadAsync(): Windows.Foundation.IAsyncOperation; - static createFromFile(file: Windows.Storage.IStorageFile): Windows.Storage.Streams.RandomAccessStreamReference; - static createFromUri(uri: Windows.Foundation.Uri): Windows.Storage.Streams.RandomAccessStreamReference; - static createFromStream(stream: Windows.Storage.Streams.IRandomAccessStream): Windows.Storage.Streams.RandomAccessStreamReference; - } - export class FileRandomAccessStream implements Windows.Storage.Streams.IRandomAccessStream, Windows.Foundation.IClosable, Windows.Storage.Streams.IInputStream, Windows.Storage.Streams.IOutputStream { - canRead: boolean; - canWrite: boolean; - position: number; - size: number; - getInputStreamAt(position: number): Windows.Storage.Streams.IInputStream; - getOutputStreamAt(position: number): Windows.Storage.Streams.IOutputStream; - seek(position: number): void; - cloneStream(): Windows.Storage.Streams.IRandomAccessStream; - dispose(): void; - readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IAsyncOperationWithProgress; - writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperationWithProgress; - flushAsync(): Windows.Foundation.IAsyncOperation; - close(): void; - } - export class FileInputStream implements Windows.Storage.Streams.IInputStream, Windows.Foundation.IClosable { - readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IAsyncOperationWithProgress; - dispose(): void; - close(): void; - } - export class FileOutputStream implements Windows.Storage.Streams.IOutputStream, Windows.Foundation.IClosable { - writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperationWithProgress; - flushAsync(): Windows.Foundation.IAsyncOperation; - dispose(): void; - close(): void; - } - export class RandomAccessStreamOverStream implements Windows.Storage.Streams.IRandomAccessStream, Windows.Foundation.IClosable, Windows.Storage.Streams.IInputStream, Windows.Storage.Streams.IOutputStream { - canRead: boolean; - canWrite: boolean; - position: number; - size: number; - getInputStreamAt(position: number): Windows.Storage.Streams.IInputStream; - getOutputStreamAt(position: number): Windows.Storage.Streams.IOutputStream; - seek(position: number): void; - cloneStream(): Windows.Storage.Streams.IRandomAccessStream; - dispose(): void; - readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IAsyncOperationWithProgress; - writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperationWithProgress; - flushAsync(): Windows.Foundation.IAsyncOperation; - close(): void; - } - export class InputStreamOverStream implements Windows.Storage.Streams.IInputStream, Windows.Foundation.IClosable { - readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IAsyncOperationWithProgress; - dispose(): void; - close(): void; - } - export class OutputStreamOverStream implements Windows.Storage.Streams.IOutputStream, Windows.Foundation.IClosable { - writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperationWithProgress; - flushAsync(): Windows.Foundation.IAsyncOperation; - dispose(): void; - close(): void; - } - export class InMemoryRandomAccessStream implements Windows.Storage.Streams.IRandomAccessStream, Windows.Foundation.IClosable, Windows.Storage.Streams.IInputStream, Windows.Storage.Streams.IOutputStream { - canRead: boolean; - canWrite: boolean; - position: number; - size: number; - getInputStreamAt(position: number): Windows.Storage.Streams.IInputStream; - getOutputStreamAt(position: number): Windows.Storage.Streams.IOutputStream; - seek(position: number): void; - cloneStream(): Windows.Storage.Streams.IRandomAccessStream; - dispose(): void; - readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IAsyncOperationWithProgress; - writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperationWithProgress; - flushAsync(): Windows.Foundation.IAsyncOperation; - close(): void; - } - export interface IInputStream extends Windows.Foundation.IClosable { - readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IAsyncOperationWithProgress; - } - export interface IOutputStream extends Windows.Foundation.IClosable { - writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperationWithProgress; - flushAsync(): Windows.Foundation.IAsyncOperation; - } - export interface IRandomAccessStream extends Windows.Foundation.IClosable, Windows.Storage.Streams.IInputStream, Windows.Storage.Streams.IOutputStream { - canRead: boolean; - canWrite: boolean; - position: number; - size: number; - getInputStreamAt(position: number): Windows.Storage.Streams.IInputStream; - getOutputStreamAt(position: number): Windows.Storage.Streams.IOutputStream; - seek(position: number): void; - cloneStream(): Windows.Storage.Streams.IRandomAccessStream; - } - export interface IRandomAccessStreamWithContentType extends Windows.Storage.Streams.IRandomAccessStream, Windows.Foundation.IClosable, Windows.Storage.Streams.IInputStream, Windows.Storage.Streams.IOutputStream, Windows.Storage.Streams.IContentTypeProvider { - } - } - } -} -declare module Windows { - export module Storage { - export module Pickers { - export module Provider { - export interface IFileRemovedEventArgs { - id: string; - } - export class FileRemovedEventArgs implements Windows.Storage.Pickers.Provider.IFileRemovedEventArgs { - id: string; - } - export enum AddFileResult { - added, - alreadyAdded, - notAllowed, - unavailable, - } - export enum FileSelectionMode { - single, - multiple, - } - export interface IFileOpenPickerUI { - allowedFileTypes: Windows.Foundation.Collections.IVectorView; - selectionMode: Windows.Storage.Pickers.Provider.FileSelectionMode; - settingsIdentifier: string; - title: string; - addFile(id: string, file: Windows.Storage.IStorageFile): Windows.Storage.Pickers.Provider.AddFileResult; - removeFile(id: string): void; - containsFile(id: string): boolean; - canAddFile(file: Windows.Storage.IStorageFile): boolean; - onfileremoved: any/* TODO */; - onclosing: any/* TODO */; - } - export class FileOpenPickerUI implements Windows.Storage.Pickers.Provider.IFileOpenPickerUI { - allowedFileTypes: Windows.Foundation.Collections.IVectorView; - selectionMode: Windows.Storage.Pickers.Provider.FileSelectionMode; - settingsIdentifier: string; - title: string; - addFile(id: string, file: Windows.Storage.IStorageFile): Windows.Storage.Pickers.Provider.AddFileResult; - removeFile(id: string): void; - containsFile(id: string): boolean; - canAddFile(file: Windows.Storage.IStorageFile): boolean; - onfileremoved: any/* TODO */; - onclosing: any/* TODO */; - } - export class PickerClosingEventArgs implements Windows.Storage.Pickers.Provider.IPickerClosingEventArgs { - closingOperation: Windows.Storage.Pickers.Provider.PickerClosingOperation; - isCanceled: boolean; - } - export interface IPickerClosingEventArgs { - closingOperation: Windows.Storage.Pickers.Provider.PickerClosingOperation; - isCanceled: boolean; - } - export class PickerClosingOperation implements Windows.Storage.Pickers.Provider.IPickerClosingOperation { - deadline: Date; - getDeferral(): Windows.Storage.Pickers.Provider.PickerClosingDeferral; - } - export interface IPickerClosingOperation { - deadline: Date; - getDeferral(): Windows.Storage.Pickers.Provider.PickerClosingDeferral; - } - export class PickerClosingDeferral implements Windows.Storage.Pickers.Provider.IPickerClosingDeferral { - complete(): void; - } - export interface IPickerClosingDeferral { - complete(): void; - } - export enum SetFileNameResult { - succeeded, - notAllowed, - unavailable, - } - export interface IFileSavePickerUI { - allowedFileTypes: Windows.Foundation.Collections.IVectorView; - fileName: string; - settingsIdentifier: string; - title: string; - trySetFileName(value: string): Windows.Storage.Pickers.Provider.SetFileNameResult; - onfilenamechanged: any/* TODO */; - ontargetfilerequested: any/* TODO */; - } - export class FileSavePickerUI implements Windows.Storage.Pickers.Provider.IFileSavePickerUI { - allowedFileTypes: Windows.Foundation.Collections.IVectorView; - fileName: string; - settingsIdentifier: string; - title: string; - trySetFileName(value: string): Windows.Storage.Pickers.Provider.SetFileNameResult; - onfilenamechanged: any/* TODO */; - ontargetfilerequested: any/* TODO */; - } - export class TargetFileRequestedEventArgs implements Windows.Storage.Pickers.Provider.ITargetFileRequestedEventArgs { - request: Windows.Storage.Pickers.Provider.TargetFileRequest; - } - export interface ITargetFileRequestedEventArgs { - request: Windows.Storage.Pickers.Provider.TargetFileRequest; - } - export class TargetFileRequest implements Windows.Storage.Pickers.Provider.ITargetFileRequest { - targetFile: Windows.Storage.IStorageFile; - getDeferral(): Windows.Storage.Pickers.Provider.TargetFileRequestDeferral; - } - export interface ITargetFileRequest { - targetFile: Windows.Storage.IStorageFile; - getDeferral(): Windows.Storage.Pickers.Provider.TargetFileRequestDeferral; - } - export class TargetFileRequestDeferral implements Windows.Storage.Pickers.Provider.ITargetFileRequestDeferral { - complete(): void; - } - export interface ITargetFileRequestDeferral { - complete(): void; - } - } - } - } -} -declare module Windows { - export module Storage { - export module Provider { - export enum CachedFileTarget { - local, - remote, - } - export enum UIStatus { - unavailable, - hidden, - visible, - complete, - } - export interface ICachedFileUpdaterUI { - title: string; - uIStatus: Windows.Storage.Provider.UIStatus; - updateTarget: Windows.Storage.Provider.CachedFileTarget; - onfileupdaterequested: any/* TODO */; - onuirequested: any/* TODO */; - } - export class CachedFileUpdaterUI implements Windows.Storage.Provider.ICachedFileUpdaterUI { - title: string; - uIStatus: Windows.Storage.Provider.UIStatus; - updateTarget: Windows.Storage.Provider.CachedFileTarget; - onfileupdaterequested: any/* TODO */; - onuirequested: any/* TODO */; - } - export class FileUpdateRequestedEventArgs implements Windows.Storage.Provider.IFileUpdateRequestedEventArgs { - request: Windows.Storage.Provider.FileUpdateRequest; - } - export interface IFileUpdateRequestedEventArgs { - request: Windows.Storage.Provider.FileUpdateRequest; - } - export class FileUpdateRequest implements Windows.Storage.Provider.IFileUpdateRequest { - contentId: string; - file: Windows.Storage.StorageFile; - status: Windows.Storage.Provider.FileUpdateStatus; - getDeferral(): Windows.Storage.Provider.FileUpdateRequestDeferral; - updateLocalFile(value: Windows.Storage.IStorageFile): void; - } - export interface IFileUpdateRequest { - contentId: string; - file: Windows.Storage.StorageFile; - status: Windows.Storage.Provider.FileUpdateStatus; - getDeferral(): Windows.Storage.Provider.FileUpdateRequestDeferral; - updateLocalFile(value: Windows.Storage.IStorageFile): void; - } - export class FileUpdateRequestDeferral implements Windows.Storage.Provider.IFileUpdateRequestDeferral { - complete(): void; - } - export interface IFileUpdateRequestDeferral { - complete(): void; - } - export enum FileUpdateStatus { - incomplete, - complete, - userInputNeeded, - currentlyUnavailable, - failed, - completeAndRenamed, - } - export enum CachedFileOptions { - none, - requireUpdateOnAccess, - useCachedFileWhenOffline, - denyAccessWhenOffline, - } - export enum ReadActivationMode { - notNeeded, - beforeAccess, - } - export enum WriteActivationMode { - readOnly, - notNeeded, - afterWrite, - } - export interface ICachedFileUpdaterStatics { - setUpdateInformation(file: Windows.Storage.IStorageFile, contentId: string, readMode: Windows.Storage.Provider.ReadActivationMode, writeMode: Windows.Storage.Provider.WriteActivationMode, options: Windows.Storage.Provider.CachedFileOptions): void; - } - export class CachedFileUpdater { - static setUpdateInformation(file: Windows.Storage.IStorageFile, contentId: string, readMode: Windows.Storage.Provider.ReadActivationMode, writeMode: Windows.Storage.Provider.WriteActivationMode, options: Windows.Storage.Provider.CachedFileOptions): void; - } - } - } -} -declare module Windows { - export module Storage { - export module FileProperties { - export enum PropertyPrefetchOptions { - none, - musicProperties, - videoProperties, - imageProperties, - documentProperties, - basicProperties, - } - export enum ThumbnailType { - image, - icon, - } - export interface IThumbnailProperties { - originalHeight: number; - originalWidth: number; - returnedSmallerCachedSize: boolean; - type: Windows.Storage.FileProperties.ThumbnailType; - } - export class StorageItemThumbnail implements Windows.Storage.Streams.IRandomAccessStreamWithContentType, Windows.Storage.Streams.IRandomAccessStream, Windows.Foundation.IClosable, Windows.Storage.Streams.IInputStream, Windows.Storage.Streams.IOutputStream, Windows.Storage.Streams.IContentTypeProvider, Windows.Storage.FileProperties.IThumbnailProperties { - canRead: boolean; - canWrite: boolean; - position: number; - size: number; - contentType: string; - originalHeight: number; - originalWidth: number; - returnedSmallerCachedSize: boolean; - type: Windows.Storage.FileProperties.ThumbnailType; - getInputStreamAt(position: number): Windows.Storage.Streams.IInputStream; - getOutputStreamAt(position: number): Windows.Storage.Streams.IOutputStream; - seek(position: number): void; - cloneStream(): Windows.Storage.Streams.IRandomAccessStream; - dispose(): void; - readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IAsyncOperationWithProgress; - writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperationWithProgress; - flushAsync(): Windows.Foundation.IAsyncOperation; - close(): void; - } - export enum ThumbnailMode { - picturesView, - videosView, - musicView, - documentsView, - listView, - singleItem, - } - export enum ThumbnailOptions { - none, - returnOnlyIfCached, - resizeThumbnail, - useCurrentScale, - } - export enum PhotoOrientation { - unspecified, - normal, - flipHorizontal, - rotate180, - flipVertical, - transpose, - rotate270, - transverse, - rotate90, - } - export enum VideoOrientation { - normal, - rotate90, - rotate180, - rotate270, - } - export interface IStorageItemExtraProperties { - retrievePropertiesAsync(propertiesToRetrieve: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation>; - savePropertiesAsync(propertiesToSave: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IAsyncAction; - savePropertiesAsync(): Windows.Foundation.IAsyncAction; - } - export interface IStorageItemContentProperties extends Windows.Storage.FileProperties.IStorageItemExtraProperties { - getMusicPropertiesAsync(): Windows.Foundation.IAsyncOperation; - getVideoPropertiesAsync(): Windows.Foundation.IAsyncOperation; - getImagePropertiesAsync(): Windows.Foundation.IAsyncOperation; - getDocumentPropertiesAsync(): Windows.Foundation.IAsyncOperation; - } - export class MusicProperties implements Windows.Storage.FileProperties.IMusicProperties, Windows.Storage.FileProperties.IStorageItemExtraProperties { - album: string; - albumArtist: string; - artist: string; - bitrate: number; - composers: Windows.Foundation.Collections.IVector; - conductors: Windows.Foundation.Collections.IVector; - duration: number; - genre: Windows.Foundation.Collections.IVector; - producers: Windows.Foundation.Collections.IVector; - publisher: string; - rating: number; - subtitle: string; - title: string; - trackNumber: number; - writers: Windows.Foundation.Collections.IVector; - year: number; - retrievePropertiesAsync(propertiesToRetrieve: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation>; - savePropertiesAsync(propertiesToSave: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IAsyncAction; - savePropertiesAsync(): Windows.Foundation.IAsyncAction; - } - export class VideoProperties implements Windows.Storage.FileProperties.IVideoProperties, Windows.Storage.FileProperties.IStorageItemExtraProperties { - bitrate: number; - directors: Windows.Foundation.Collections.IVector; - duration: number; - height: number; - keywords: Windows.Foundation.Collections.IVector; - latitude: number; - longitude: number; - orientation: Windows.Storage.FileProperties.VideoOrientation; - producers: Windows.Foundation.Collections.IVector; - publisher: string; - rating: number; - subtitle: string; - title: string; - width: number; - writers: Windows.Foundation.Collections.IVector; - year: number; - retrievePropertiesAsync(propertiesToRetrieve: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation>; - savePropertiesAsync(propertiesToSave: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IAsyncAction; - savePropertiesAsync(): Windows.Foundation.IAsyncAction; - } - export class ImageProperties implements Windows.Storage.FileProperties.IImageProperties, Windows.Storage.FileProperties.IStorageItemExtraProperties { - cameraManufacturer: string; - cameraModel: string; - dateTaken: Date; - height: number; - keywords: Windows.Foundation.Collections.IVector; - latitude: number; - longitude: number; - orientation: Windows.Storage.FileProperties.PhotoOrientation; - peopleNames: Windows.Foundation.Collections.IVectorView; - rating: number; - title: string; - width: number; - retrievePropertiesAsync(propertiesToRetrieve: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation>; - savePropertiesAsync(propertiesToSave: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IAsyncAction; - savePropertiesAsync(): Windows.Foundation.IAsyncAction; - } - export class DocumentProperties implements Windows.Storage.FileProperties.IDocumentProperties, Windows.Storage.FileProperties.IStorageItemExtraProperties { - author: Windows.Foundation.Collections.IVector; - comment: string; - keywords: Windows.Foundation.Collections.IVector; - title: string; - retrievePropertiesAsync(propertiesToRetrieve: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation>; - savePropertiesAsync(propertiesToSave: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IAsyncAction; - savePropertiesAsync(): Windows.Foundation.IAsyncAction; - } - export interface IMusicProperties extends Windows.Storage.FileProperties.IStorageItemExtraProperties { - album: string; - albumArtist: string; - artist: string; - bitrate: number; - composers: Windows.Foundation.Collections.IVector; - conductors: Windows.Foundation.Collections.IVector; - duration: number; - genre: Windows.Foundation.Collections.IVector; - producers: Windows.Foundation.Collections.IVector; - publisher: string; - rating: number; - subtitle: string; - title: string; - trackNumber: number; - writers: Windows.Foundation.Collections.IVector; - year: number; - } - export interface IImageProperties extends Windows.Storage.FileProperties.IStorageItemExtraProperties { - cameraManufacturer: string; - cameraModel: string; - dateTaken: Date; - height: number; - keywords: Windows.Foundation.Collections.IVector; - latitude: number; - longitude: number; - orientation: Windows.Storage.FileProperties.PhotoOrientation; - peopleNames: Windows.Foundation.Collections.IVectorView; - rating: number; - title: string; - width: number; - } - export interface IVideoProperties extends Windows.Storage.FileProperties.IStorageItemExtraProperties { - bitrate: number; - directors: Windows.Foundation.Collections.IVector; - duration: number; - height: number; - keywords: Windows.Foundation.Collections.IVector; - latitude: number; - longitude: number; - orientation: Windows.Storage.FileProperties.VideoOrientation; - producers: Windows.Foundation.Collections.IVector; - publisher: string; - rating: number; - subtitle: string; - title: string; - width: number; - writers: Windows.Foundation.Collections.IVector; - year: number; - } - export interface IDocumentProperties extends Windows.Storage.FileProperties.IStorageItemExtraProperties { - author: Windows.Foundation.Collections.IVector; - comment: string; - keywords: Windows.Foundation.Collections.IVector; - title: string; - } - export interface IBasicProperties { - dateModified: Date; - itemDate: Date; - size: number; - } - export class StorageItemContentProperties implements Windows.Storage.FileProperties.IStorageItemContentProperties, Windows.Storage.FileProperties.IStorageItemExtraProperties { - getMusicPropertiesAsync(): Windows.Foundation.IAsyncOperation; - getVideoPropertiesAsync(): Windows.Foundation.IAsyncOperation; - getImagePropertiesAsync(): Windows.Foundation.IAsyncOperation; - getDocumentPropertiesAsync(): Windows.Foundation.IAsyncOperation; - retrievePropertiesAsync(propertiesToRetrieve: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation>; - savePropertiesAsync(propertiesToSave: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IAsyncAction; - savePropertiesAsync(): Windows.Foundation.IAsyncAction; - } - export class BasicProperties implements Windows.Storage.FileProperties.IBasicProperties, Windows.Storage.FileProperties.IStorageItemExtraProperties { - dateModified: Date; - itemDate: Date; - size: number; - retrievePropertiesAsync(propertiesToRetrieve: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncOperation>; - savePropertiesAsync(propertiesToSave: Windows.Foundation.Collections.IIterable>): Windows.Foundation.IAsyncAction; - savePropertiesAsync(): Windows.Foundation.IAsyncAction; - } - } - } -} -declare module Windows { - export module Storage { - export interface IKnownFoldersStatics { - documentsLibrary: Windows.Storage.StorageFolder; - homeGroup: Windows.Storage.StorageFolder; - mediaServerDevices: Windows.Storage.StorageFolder; - musicLibrary: Windows.Storage.StorageFolder; - picturesLibrary: Windows.Storage.StorageFolder; - removableDevices: Windows.Storage.StorageFolder; - videosLibrary: Windows.Storage.StorageFolder; - } - export class StorageFolder implements Windows.Storage.IStorageFolder, Windows.Storage.IStorageItem, Windows.Storage.Search.IStorageFolderQueryOperations, Windows.Storage.IStorageItemProperties { - attributes: Windows.Storage.FileAttributes; - dateCreated: Date; - name: string; - path: string; - displayName: string; - displayType: string; - folderRelativeId: string; - properties: Windows.Storage.FileProperties.StorageItemContentProperties; - createFileAsync(desiredName: string): Windows.Foundation.IAsyncOperation; - createFileAsync(desiredName: string, options: Windows.Storage.CreationCollisionOption): Windows.Foundation.IAsyncOperation; - createFolderAsync(desiredName: string): Windows.Foundation.IAsyncOperation; - createFolderAsync(desiredName: string, options: Windows.Storage.CreationCollisionOption): Windows.Foundation.IAsyncOperation; - getFileAsync(name: string): Windows.Foundation.IAsyncOperation; - getFolderAsync(name: string): Windows.Foundation.IAsyncOperation; - getItemAsync(name: string): Windows.Foundation.IAsyncOperation; - getFilesAsync(): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(): Windows.Foundation.IAsyncOperation>; - getItemsAsync(): Windows.Foundation.IAsyncOperation>; - renameAsync(desiredName: string): Windows.Foundation.IAsyncAction; - renameAsync(desiredName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncAction; - deleteAsync(): Windows.Foundation.IAsyncAction; - deleteAsync(option: Windows.Storage.StorageDeleteOption): Windows.Foundation.IAsyncAction; - getBasicPropertiesAsync(): Windows.Foundation.IAsyncOperation; - isOfType(type: Windows.Storage.StorageItemTypes): boolean; - getIndexedStateAsync(): Windows.Foundation.IAsyncOperation; - createFileQuery(): Windows.Storage.Search.StorageFileQueryResult; - createFileQuery(query: Windows.Storage.Search.CommonFileQuery): Windows.Storage.Search.StorageFileQueryResult; - createFileQueryWithOptions(queryOptions: Windows.Storage.Search.QueryOptions): Windows.Storage.Search.StorageFileQueryResult; - createFolderQuery(): Windows.Storage.Search.StorageFolderQueryResult; - createFolderQuery(query: Windows.Storage.Search.CommonFolderQuery): Windows.Storage.Search.StorageFolderQueryResult; - createFolderQueryWithOptions(queryOptions: Windows.Storage.Search.QueryOptions): Windows.Storage.Search.StorageFolderQueryResult; - createItemQuery(): Windows.Storage.Search.StorageItemQueryResult; - createItemQueryWithOptions(queryOptions: Windows.Storage.Search.QueryOptions): Windows.Storage.Search.StorageItemQueryResult; - getFilesAsync(query: Windows.Storage.Search.CommonFileQuery, startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - getFilesAsync(query: Windows.Storage.Search.CommonFileQuery): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(query: Windows.Storage.Search.CommonFolderQuery, startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(query: Windows.Storage.Search.CommonFolderQuery): Windows.Foundation.IAsyncOperation>; - getItemsAsync(startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - areQueryOptionsSupported(queryOptions: Windows.Storage.Search.QueryOptions): boolean; - isCommonFolderQuerySupported(query: Windows.Storage.Search.CommonFolderQuery): boolean; - isCommonFileQuerySupported(query: Windows.Storage.Search.CommonFileQuery): boolean; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode): Windows.Foundation.IAsyncOperation; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode, requestedSize: number): Windows.Foundation.IAsyncOperation; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode, requestedSize: number, options: Windows.Storage.FileProperties.ThumbnailOptions): Windows.Foundation.IAsyncOperation; - static getFolderFromPathAsync(path: string): Windows.Foundation.IAsyncOperation; - } - export class KnownFolders { - static documentsLibrary: Windows.Storage.StorageFolder; - static homeGroup: Windows.Storage.StorageFolder; - static mediaServerDevices: Windows.Storage.StorageFolder; - static musicLibrary: Windows.Storage.StorageFolder; - static picturesLibrary: Windows.Storage.StorageFolder; - static removableDevices: Windows.Storage.StorageFolder; - static videosLibrary: Windows.Storage.StorageFolder; - } - export enum CreationCollisionOption { - generateUniqueName, - replaceExisting, - failIfExists, - openIfExists, - } - export interface IDownloadsFolderStatics { - createFileAsync(desiredName: string): Windows.Foundation.IAsyncOperation; - createFolderAsync(desiredName: string): Windows.Foundation.IAsyncOperation; - createFileAsync(desiredName: string, option: Windows.Storage.CreationCollisionOption): Windows.Foundation.IAsyncOperation; - createFolderAsync(desiredName: string, option: Windows.Storage.CreationCollisionOption): Windows.Foundation.IAsyncOperation; - } - export class StorageFile implements Windows.Storage.IStorageFile, Windows.Storage.IStorageItem, Windows.Storage.Streams.IRandomAccessStreamReference, Windows.Storage.Streams.IInputStreamReference, Windows.Storage.IStorageItemProperties { - contentType: string; - fileType: string; - attributes: Windows.Storage.FileAttributes; - dateCreated: Date; - name: string; - path: string; - displayName: string; - displayType: string; - folderRelativeId: string; - properties: Windows.Storage.FileProperties.StorageItemContentProperties; - openAsync(accessMode: Windows.Storage.FileAccessMode): Windows.Foundation.IAsyncOperation; - openTransactedWriteAsync(): Windows.Foundation.IAsyncOperation; - copyAsync(destinationFolder: Windows.Storage.IStorageFolder): Windows.Foundation.IAsyncOperation; - copyAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string): Windows.Foundation.IAsyncOperation; - copyAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncOperation; - copyAndReplaceAsync(fileToReplace: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - moveAsync(destinationFolder: Windows.Storage.IStorageFolder): Windows.Foundation.IAsyncAction; - moveAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string): Windows.Foundation.IAsyncAction; - moveAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncAction; - moveAndReplaceAsync(fileToReplace: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - renameAsync(desiredName: string): Windows.Foundation.IAsyncAction; - renameAsync(desiredName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncAction; - deleteAsync(): Windows.Foundation.IAsyncAction; - deleteAsync(option: Windows.Storage.StorageDeleteOption): Windows.Foundation.IAsyncAction; - getBasicPropertiesAsync(): Windows.Foundation.IAsyncOperation; - isOfType(type: Windows.Storage.StorageItemTypes): boolean; - openReadAsync(): Windows.Foundation.IAsyncOperation; - openSequentialReadAsync(): Windows.Foundation.IAsyncOperation; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode): Windows.Foundation.IAsyncOperation; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode, requestedSize: number): Windows.Foundation.IAsyncOperation; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode, requestedSize: number, options: Windows.Storage.FileProperties.ThumbnailOptions): Windows.Foundation.IAsyncOperation; - static getFileFromPathAsync(path: string): Windows.Foundation.IAsyncOperation; - static getFileFromApplicationUriAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation; - static createStreamedFileAsync(displayNameWithExtension: string, dataRequested: Windows.Storage.StreamedFileDataRequestedHandler, thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IAsyncOperation; - static replaceWithStreamedFileAsync(fileToReplace: Windows.Storage.IStorageFile, dataRequested: Windows.Storage.StreamedFileDataRequestedHandler, thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IAsyncOperation; - static createStreamedFileFromUriAsync(displayNameWithExtension: string, uri: Windows.Foundation.Uri, thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IAsyncOperation; - static replaceWithStreamedFileFromUriAsync(fileToReplace: Windows.Storage.IStorageFile, uri: Windows.Foundation.Uri, thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IAsyncOperation; - } - export class DownloadsFolder { - static createFileAsync(desiredName: string): Windows.Foundation.IAsyncOperation; - static createFolderAsync(desiredName: string): Windows.Foundation.IAsyncOperation; - static createFileAsync(desiredName: string, option: Windows.Storage.CreationCollisionOption): Windows.Foundation.IAsyncOperation; - static createFolderAsync(desiredName: string, option: Windows.Storage.CreationCollisionOption): Windows.Foundation.IAsyncOperation; - } - export enum NameCollisionOption { - generateUniqueName, - replaceExisting, - failIfExists, - } - export enum StorageDeleteOption { - default, - permanentDelete, - } - export enum StorageItemTypes { - none, - file, - folder, - } - export enum FileAttributes { - normal, - readOnly, - directory, - archive, - temporary, - } - export enum FileAccessMode { - read, - readWrite, - } - export enum StreamedFileFailureMode { - failed, - currentlyUnavailable, - incomplete, - } - export interface IStreamedFileDataRequest { - failAndClose(failureMode: Windows.Storage.StreamedFileFailureMode): void; - } - export class StreamedFileDataRequest implements Windows.Storage.Streams.IOutputStream, Windows.Foundation.IClosable, Windows.Storage.IStreamedFileDataRequest { - writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperationWithProgress; - flushAsync(): Windows.Foundation.IAsyncOperation; - dispose(): void; - failAndClose(failureMode: Windows.Storage.StreamedFileFailureMode): void; - close(): void; - } - export interface StreamedFileDataRequestedHandler { - (stream: Windows.Storage.StreamedFileDataRequest): void; - } - export interface IStorageFileStatics { - getFileFromPathAsync(path: string): Windows.Foundation.IAsyncOperation; - getFileFromApplicationUriAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation; - createStreamedFileAsync(displayNameWithExtension: string, dataRequested: Windows.Storage.StreamedFileDataRequestedHandler, thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IAsyncOperation; - replaceWithStreamedFileAsync(fileToReplace: Windows.Storage.IStorageFile, dataRequested: Windows.Storage.StreamedFileDataRequestedHandler, thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IAsyncOperation; - createStreamedFileFromUriAsync(displayNameWithExtension: string, uri: Windows.Foundation.Uri, thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IAsyncOperation; - replaceWithStreamedFileFromUriAsync(fileToReplace: Windows.Storage.IStorageFile, uri: Windows.Foundation.Uri, thumbnail: Windows.Storage.Streams.IRandomAccessStreamReference): Windows.Foundation.IAsyncOperation; - } - export class StorageStreamTransaction implements Windows.Storage.IStorageStreamTransaction, Windows.Foundation.IClosable { - stream: Windows.Storage.Streams.IRandomAccessStream; - commitAsync(): Windows.Foundation.IAsyncAction; - dispose(): void; - close(): void; - } - export interface IStorageItem { - attributes: Windows.Storage.FileAttributes; - dateCreated: Date; - name: string; - path: string; - renameAsync(desiredName: string): Windows.Foundation.IAsyncAction; - renameAsync(desiredName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncAction; - deleteAsync(): Windows.Foundation.IAsyncAction; - deleteAsync(option: Windows.Storage.StorageDeleteOption): Windows.Foundation.IAsyncAction; - getBasicPropertiesAsync(): Windows.Foundation.IAsyncOperation; - isOfType(type: Windows.Storage.StorageItemTypes): boolean; - } - export interface IStorageFolder extends Windows.Storage.IStorageItem { - createFileAsync(desiredName: string): Windows.Foundation.IAsyncOperation; - createFileAsync(desiredName: string, options: Windows.Storage.CreationCollisionOption): Windows.Foundation.IAsyncOperation; - createFolderAsync(desiredName: string): Windows.Foundation.IAsyncOperation; - createFolderAsync(desiredName: string, options: Windows.Storage.CreationCollisionOption): Windows.Foundation.IAsyncOperation; - getFileAsync(name: string): Windows.Foundation.IAsyncOperation; - getFolderAsync(name: string): Windows.Foundation.IAsyncOperation; - getItemAsync(name: string): Windows.Foundation.IAsyncOperation; - getFilesAsync(): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(): Windows.Foundation.IAsyncOperation>; - getItemsAsync(): Windows.Foundation.IAsyncOperation>; - } - export interface IStorageFile extends Windows.Storage.IStorageItem, Windows.Storage.Streams.IRandomAccessStreamReference, Windows.Storage.Streams.IInputStreamReference { - contentType: string; - fileType: string; - openAsync(accessMode: Windows.Storage.FileAccessMode): Windows.Foundation.IAsyncOperation; - openTransactedWriteAsync(): Windows.Foundation.IAsyncOperation; - copyAsync(destinationFolder: Windows.Storage.IStorageFolder): Windows.Foundation.IAsyncOperation; - copyAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string): Windows.Foundation.IAsyncOperation; - copyAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncOperation; - copyAndReplaceAsync(fileToReplace: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - moveAsync(destinationFolder: Windows.Storage.IStorageFolder): Windows.Foundation.IAsyncAction; - moveAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string): Windows.Foundation.IAsyncAction; - moveAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncAction; - moveAndReplaceAsync(fileToReplace: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - } - export interface IStorageFolderStatics { - getFolderFromPathAsync(path: string): Windows.Foundation.IAsyncOperation; - } - export interface IStorageItemProperties { - displayName: string; - displayType: string; - folderRelativeId: string; - properties: Windows.Storage.FileProperties.StorageItemContentProperties; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode): Windows.Foundation.IAsyncOperation; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode, requestedSize: number): Windows.Foundation.IAsyncOperation; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode, requestedSize: number, options: Windows.Storage.FileProperties.ThumbnailOptions): Windows.Foundation.IAsyncOperation; - } - export interface IFileIOStatics { - readTextAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - readTextAsync(file: Windows.Storage.IStorageFile, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncOperation; - writeTextAsync(file: Windows.Storage.IStorageFile, contents: string): Windows.Foundation.IAsyncAction; - writeTextAsync(file: Windows.Storage.IStorageFile, contents: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - appendTextAsync(file: Windows.Storage.IStorageFile, contents: string): Windows.Foundation.IAsyncAction; - appendTextAsync(file: Windows.Storage.IStorageFile, contents: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - readLinesAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation>; - readLinesAsync(file: Windows.Storage.IStorageFile, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncOperation>; - writeLinesAsync(file: Windows.Storage.IStorageFile, lines: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncAction; - writeLinesAsync(file: Windows.Storage.IStorageFile, lines: Windows.Foundation.Collections.IIterable, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - appendLinesAsync(file: Windows.Storage.IStorageFile, lines: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncAction; - appendLinesAsync(file: Windows.Storage.IStorageFile, lines: Windows.Foundation.Collections.IIterable, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - readBufferAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - writeBufferAsync(file: Windows.Storage.IStorageFile, buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncAction; - writeBytesAsync(file: Windows.Storage.IStorageFile, buffer: Uint8Array): Windows.Foundation.IAsyncAction; - } - export class FileIO { - static readTextAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - static readTextAsync(file: Windows.Storage.IStorageFile, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncOperation; - static writeTextAsync(file: Windows.Storage.IStorageFile, contents: string): Windows.Foundation.IAsyncAction; - static writeTextAsync(file: Windows.Storage.IStorageFile, contents: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - static appendTextAsync(file: Windows.Storage.IStorageFile, contents: string): Windows.Foundation.IAsyncAction; - static appendTextAsync(file: Windows.Storage.IStorageFile, contents: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - static readLinesAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation>; - static readLinesAsync(file: Windows.Storage.IStorageFile, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncOperation>; - static writeLinesAsync(file: Windows.Storage.IStorageFile, lines: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncAction; - static writeLinesAsync(file: Windows.Storage.IStorageFile, lines: Windows.Foundation.Collections.IIterable, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - static appendLinesAsync(file: Windows.Storage.IStorageFile, lines: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncAction; - static appendLinesAsync(file: Windows.Storage.IStorageFile, lines: Windows.Foundation.Collections.IIterable, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - static readBufferAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - static writeBufferAsync(file: Windows.Storage.IStorageFile, buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncAction; - static writeBytesAsync(file: Windows.Storage.IStorageFile, buffer: Uint8Array): Windows.Foundation.IAsyncAction; - } - export interface IPathIOStatics { - readTextAsync(absolutePath: string): Windows.Foundation.IAsyncOperation; - readTextAsync(absolutePath: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncOperation; - writeTextAsync(absolutePath: string, contents: string): Windows.Foundation.IAsyncAction; - writeTextAsync(absolutePath: string, contents: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - appendTextAsync(absolutePath: string, contents: string): Windows.Foundation.IAsyncAction; - appendTextAsync(absolutePath: string, contents: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - readLinesAsync(absolutePath: string): Windows.Foundation.IAsyncOperation>; - readLinesAsync(absolutePath: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncOperation>; - writeLinesAsync(absolutePath: string, lines: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncAction; - writeLinesAsync(absolutePath: string, lines: Windows.Foundation.Collections.IIterable, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - appendLinesAsync(absolutePath: string, lines: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncAction; - appendLinesAsync(absolutePath: string, lines: Windows.Foundation.Collections.IIterable, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - readBufferAsync(absolutePath: string): Windows.Foundation.IAsyncOperation; - writeBufferAsync(absolutePath: string, buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncAction; - writeBytesAsync(absolutePath: string, buffer: Uint8Array): Windows.Foundation.IAsyncAction; - } - export class PathIO { - static readTextAsync(absolutePath: string): Windows.Foundation.IAsyncOperation; - static readTextAsync(absolutePath: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncOperation; - static writeTextAsync(absolutePath: string, contents: string): Windows.Foundation.IAsyncAction; - static writeTextAsync(absolutePath: string, contents: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - static appendTextAsync(absolutePath: string, contents: string): Windows.Foundation.IAsyncAction; - static appendTextAsync(absolutePath: string, contents: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - static readLinesAsync(absolutePath: string): Windows.Foundation.IAsyncOperation>; - static readLinesAsync(absolutePath: string, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncOperation>; - static writeLinesAsync(absolutePath: string, lines: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncAction; - static writeLinesAsync(absolutePath: string, lines: Windows.Foundation.Collections.IIterable, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - static appendLinesAsync(absolutePath: string, lines: Windows.Foundation.Collections.IIterable): Windows.Foundation.IAsyncAction; - static appendLinesAsync(absolutePath: string, lines: Windows.Foundation.Collections.IIterable, encoding: Windows.Storage.Streams.UnicodeEncoding): Windows.Foundation.IAsyncAction; - static readBufferAsync(absolutePath: string): Windows.Foundation.IAsyncOperation; - static writeBufferAsync(absolutePath: string, buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncAction; - static writeBytesAsync(absolutePath: string, buffer: Uint8Array): Windows.Foundation.IAsyncAction; - } - export interface ICachedFileManagerStatics { - deferUpdates(file: Windows.Storage.IStorageFile): void; - completeUpdatesAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - } - export class CachedFileManager { - static deferUpdates(file: Windows.Storage.IStorageFile): void; - static completeUpdatesAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - } - export interface IStorageStreamTransaction extends Windows.Foundation.IClosable { - stream: Windows.Storage.Streams.IRandomAccessStream; - commitAsync(): Windows.Foundation.IAsyncAction; - } - export enum ApplicationDataLocality { - local, - roaming, - temporary, - } - export enum ApplicationDataCreateDisposition { - always, - existing, - } - export interface IApplicationDataStatics { - current: Windows.Storage.ApplicationData; - } - export class ApplicationData implements Windows.Storage.IApplicationData { - localFolder: Windows.Storage.StorageFolder; - localSettings: Windows.Storage.ApplicationDataContainer; - roamingFolder: Windows.Storage.StorageFolder; - roamingSettings: Windows.Storage.ApplicationDataContainer; - roamingStorageQuota: number; - temporaryFolder: Windows.Storage.StorageFolder; - version: number; - setVersionAsync(desiredVersion: number, handler: Windows.Storage.ApplicationDataSetVersionHandler): Windows.Foundation.IAsyncAction; - clearAsync(): Windows.Foundation.IAsyncAction; - clearAsync(locality: Windows.Storage.ApplicationDataLocality): Windows.Foundation.IAsyncAction; - ondatachanged: any/* TODO */; - signalDataChanged(): void; - static current: Windows.Storage.ApplicationData; - } - export interface IApplicationData { - localFolder: Windows.Storage.StorageFolder; - localSettings: Windows.Storage.ApplicationDataContainer; - roamingFolder: Windows.Storage.StorageFolder; - roamingSettings: Windows.Storage.ApplicationDataContainer; - roamingStorageQuota: number; - temporaryFolder: Windows.Storage.StorageFolder; - version: number; - setVersionAsync(desiredVersion: number, handler: Windows.Storage.ApplicationDataSetVersionHandler): Windows.Foundation.IAsyncAction; - clearAsync(): Windows.Foundation.IAsyncAction; - clearAsync(locality: Windows.Storage.ApplicationDataLocality): Windows.Foundation.IAsyncAction; - ondatachanged: any/* TODO */; - signalDataChanged(): void; - } - export interface ApplicationDataSetVersionHandler { - (setVersionRequest: Windows.Storage.SetVersionRequest): void; - } - export class SetVersionRequest implements Windows.Storage.ISetVersionRequest { - currentVersion: number; - desiredVersion: number; - getDeferral(): Windows.Storage.SetVersionDeferral; - } - export class ApplicationDataContainer implements Windows.Storage.IApplicationDataContainer { - containers: Windows.Foundation.Collections.IMapView; - locality: Windows.Storage.ApplicationDataLocality; - name: string; - values: Windows.Foundation.Collections.IPropertySet; - createContainer(name: string, disposition: Windows.Storage.ApplicationDataCreateDisposition): Windows.Storage.ApplicationDataContainer; - deleteContainer(name: string): void; - } - export interface ISetVersionRequest { - currentVersion: number; - desiredVersion: number; - getDeferral(): Windows.Storage.SetVersionDeferral; - } - export class SetVersionDeferral implements Windows.Storage.ISetVersionDeferral { - complete(): void; - } - export interface ISetVersionDeferral { - complete(): void; - } - export interface IApplicationDataContainer { - containers: Windows.Foundation.Collections.IMapView; - locality: Windows.Storage.ApplicationDataLocality; - name: string; - values: Windows.Foundation.Collections.IPropertySet; - createContainer(name: string, disposition: Windows.Storage.ApplicationDataCreateDisposition): Windows.Storage.ApplicationDataContainer; - deleteContainer(name: string): void; - } - export class ApplicationDataContainerSettings implements Windows.Foundation.Collections.IPropertySet, Windows.Foundation.Collections.IObservableMap, Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { - size: number; - onmapchanged: any/* TODO */; - lookup(key: string): any; - hasKey(key: string): boolean; - getView(): Windows.Foundation.Collections.IMapView; - insert(key: string, value: any): boolean; - remove(key: string): void; - clear(): void; - first(): Windows.Foundation.Collections.IIterator>; - } - export class ApplicationDataCompositeValue implements Windows.Foundation.Collections.IPropertySet, Windows.Foundation.Collections.IObservableMap, Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { - size: number; - onmapchanged: any/* TODO */; - lookup(key: string): any; - hasKey(key: string): boolean; - getView(): Windows.Foundation.Collections.IMapView; - insert(key: string, value: any): boolean; - remove(key: string): void; - clear(): void; - first(): Windows.Foundation.Collections.IIterator>; - } - } -} -declare module Windows { - export module Storage { - export module Search { - export interface SortEntry { - propertyName: string; - ascendingOrder: boolean; - } - export enum DateStackOption { - none, - year, - month, - } - export enum IndexerOption { - useIndexerWhenAvailable, - onlyUseIndexer, - doNotUseIndexer, - } - export enum FolderDepth { - shallow, - deep, - } - export enum CommonFileQuery { - defaultQuery, - orderByName, - orderByTitle, - orderByMusicProperties, - orderBySearchRank, - orderByDate, - } - export enum CommonFolderQuery { - defaultQuery, - groupByYear, - groupByMonth, - groupByArtist, - groupByAlbum, - groupByAlbumArtist, - groupByComposer, - groupByGenre, - groupByPublishedYear, - groupByRating, - groupByTag, - groupByAuthor, - groupByType, - } - export enum IndexedState { - unknown, - notIndexed, - partiallyIndexed, - fullyIndexed, - } - export interface IQueryOptions { - applicationSearchFilter: string; - dateStackOption: Windows.Storage.Search.DateStackOption; - fileTypeFilter: Windows.Foundation.Collections.IVector; - folderDepth: Windows.Storage.Search.FolderDepth; - groupPropertyName: string; - indexerOption: Windows.Storage.Search.IndexerOption; - language: string; - sortOrder: Windows.Foundation.Collections.IVector; - userSearchFilter: string; - saveToString(): string; - loadFromString(value: string): void; - setThumbnailPrefetch(mode: Windows.Storage.FileProperties.ThumbnailMode, requestedSize: number, options: Windows.Storage.FileProperties.ThumbnailOptions): void; - setPropertyPrefetch(options: Windows.Storage.FileProperties.PropertyPrefetchOptions, propertiesToRetrieve: Windows.Foundation.Collections.IIterable): void; - } - export interface IQueryOptionsFactory { - createCommonFileQuery(query: Windows.Storage.Search.CommonFileQuery, fileTypeFilter: Windows.Foundation.Collections.IIterable): Windows.Storage.Search.QueryOptions; - createCommonFolderQuery(query: Windows.Storage.Search.CommonFolderQuery): Windows.Storage.Search.QueryOptions; - } - export class QueryOptions implements Windows.Storage.Search.IQueryOptions { - constructor(query: Windows.Storage.Search.CommonFileQuery, fileTypeFilter: Windows.Foundation.Collections.IIterable); - constructor(query: Windows.Storage.Search.CommonFolderQuery); - constructor(); - applicationSearchFilter: string; - dateStackOption: Windows.Storage.Search.DateStackOption; - fileTypeFilter: Windows.Foundation.Collections.IVector; - folderDepth: Windows.Storage.Search.FolderDepth; - groupPropertyName: string; - indexerOption: Windows.Storage.Search.IndexerOption; - language: string; - sortOrder: Windows.Foundation.Collections.IVector; - userSearchFilter: string; - saveToString(): string; - loadFromString(value: string): void; - setThumbnailPrefetch(mode: Windows.Storage.FileProperties.ThumbnailMode, requestedSize: number, options: Windows.Storage.FileProperties.ThumbnailOptions): void; - setPropertyPrefetch(options: Windows.Storage.FileProperties.PropertyPrefetchOptions, propertiesToRetrieve: Windows.Foundation.Collections.IIterable): void; - } - export interface IStorageQueryResultBase { - folder: Windows.Storage.StorageFolder; - getItemCountAsync(): Windows.Foundation.IAsyncOperation; - oncontentschanged: any/* TODO */; - onoptionschanged: any/* TODO */; - findStartIndexAsync(value: any): Windows.Foundation.IAsyncOperation; - getCurrentQueryOptions(): Windows.Storage.Search.QueryOptions; - applyNewQueryOptions(newQueryOptions: Windows.Storage.Search.QueryOptions): void; - } - export interface IStorageFileQueryResult extends Windows.Storage.Search.IStorageQueryResultBase { - getFilesAsync(startIndex: number, maxNumberOfItems: number): Windows.Foundation.IAsyncOperation>; - getFilesAsync(): Windows.Foundation.IAsyncOperation>; - } - export interface IStorageFolderQueryResult extends Windows.Storage.Search.IStorageQueryResultBase { - getFoldersAsync(startIndex: number, maxNumberOfItems: number): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(): Windows.Foundation.IAsyncOperation>; - } - export interface IStorageItemQueryResult extends Windows.Storage.Search.IStorageQueryResultBase { - getItemsAsync(startIndex: number, maxNumberOfItems: number): Windows.Foundation.IAsyncOperation>; - getItemsAsync(): Windows.Foundation.IAsyncOperation>; - } - export interface IStorageFolderQueryOperations { - getIndexedStateAsync(): Windows.Foundation.IAsyncOperation; - createFileQuery(): Windows.Storage.Search.StorageFileQueryResult; - createFileQuery(query: Windows.Storage.Search.CommonFileQuery): Windows.Storage.Search.StorageFileQueryResult; - createFileQueryWithOptions(queryOptions: Windows.Storage.Search.QueryOptions): Windows.Storage.Search.StorageFileQueryResult; - createFolderQuery(): Windows.Storage.Search.StorageFolderQueryResult; - createFolderQuery(query: Windows.Storage.Search.CommonFolderQuery): Windows.Storage.Search.StorageFolderQueryResult; - createFolderQueryWithOptions(queryOptions: Windows.Storage.Search.QueryOptions): Windows.Storage.Search.StorageFolderQueryResult; - createItemQuery(): Windows.Storage.Search.StorageItemQueryResult; - createItemQueryWithOptions(queryOptions: Windows.Storage.Search.QueryOptions): Windows.Storage.Search.StorageItemQueryResult; - getFilesAsync(query: Windows.Storage.Search.CommonFileQuery, startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - getFilesAsync(query: Windows.Storage.Search.CommonFileQuery): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(query: Windows.Storage.Search.CommonFolderQuery, startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(query: Windows.Storage.Search.CommonFolderQuery): Windows.Foundation.IAsyncOperation>; - getItemsAsync(startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - areQueryOptionsSupported(queryOptions: Windows.Storage.Search.QueryOptions): boolean; - isCommonFolderQuerySupported(query: Windows.Storage.Search.CommonFolderQuery): boolean; - isCommonFileQuerySupported(query: Windows.Storage.Search.CommonFileQuery): boolean; - } - export class StorageFileQueryResult implements Windows.Storage.Search.IStorageFileQueryResult, Windows.Storage.Search.IStorageQueryResultBase { - folder: Windows.Storage.StorageFolder; - getFilesAsync(startIndex: number, maxNumberOfItems: number): Windows.Foundation.IAsyncOperation>; - getFilesAsync(): Windows.Foundation.IAsyncOperation>; - getItemCountAsync(): Windows.Foundation.IAsyncOperation; - oncontentschanged: any/* TODO */; - onoptionschanged: any/* TODO */; - findStartIndexAsync(value: any): Windows.Foundation.IAsyncOperation; - getCurrentQueryOptions(): Windows.Storage.Search.QueryOptions; - applyNewQueryOptions(newQueryOptions: Windows.Storage.Search.QueryOptions): void; - } - export class StorageFolderQueryResult implements Windows.Storage.Search.IStorageFolderQueryResult, Windows.Storage.Search.IStorageQueryResultBase { - folder: Windows.Storage.StorageFolder; - getFoldersAsync(startIndex: number, maxNumberOfItems: number): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(): Windows.Foundation.IAsyncOperation>; - getItemCountAsync(): Windows.Foundation.IAsyncOperation; - oncontentschanged: any/* TODO */; - onoptionschanged: any/* TODO */; - findStartIndexAsync(value: any): Windows.Foundation.IAsyncOperation; - getCurrentQueryOptions(): Windows.Storage.Search.QueryOptions; - applyNewQueryOptions(newQueryOptions: Windows.Storage.Search.QueryOptions): void; - } - export class StorageItemQueryResult implements Windows.Storage.Search.IStorageItemQueryResult, Windows.Storage.Search.IStorageQueryResultBase { - folder: Windows.Storage.StorageFolder; - getItemsAsync(startIndex: number, maxNumberOfItems: number): Windows.Foundation.IAsyncOperation>; - getItemsAsync(): Windows.Foundation.IAsyncOperation>; - getItemCountAsync(): Windows.Foundation.IAsyncOperation; - oncontentschanged: any/* TODO */; - onoptionschanged: any/* TODO */; - findStartIndexAsync(value: any): Windows.Foundation.IAsyncOperation; - getCurrentQueryOptions(): Windows.Storage.Search.QueryOptions; - applyNewQueryOptions(newQueryOptions: Windows.Storage.Search.QueryOptions): void; - } - export class SortEntryVector implements Windows.Foundation.Collections.IVector, Windows.Foundation.Collections.IIterable { - size: number; - getAt(index: number): Windows.Storage.Search.SortEntry; - getView(): Windows.Foundation.Collections.IVectorView; - indexOf(value: Windows.Storage.Search.SortEntry): { index: number; returnValue: boolean; }; - setAt(index: number, value: Windows.Storage.Search.SortEntry): void; - insertAt(index: number, value: Windows.Storage.Search.SortEntry): void; - removeAt(index: number): void; - append(value: Windows.Storage.Search.SortEntry): void; - removeAtEnd(): void; - clear(): void; - getMany(startIndex: number): { items: Windows.Storage.Search.SortEntry[]; returnValue: number; }; - replaceAll(items: Windows.Storage.Search.SortEntry[]): void; - first(): Windows.Foundation.Collections.IIterator; - toString(): string; - toLocaleString(): string; - concat(...items: Windows.Storage.Search.SortEntry[][]): Windows.Storage.Search.SortEntry[]; - join(seperator: string): string; - pop(): Windows.Storage.Search.SortEntry; - push(...items: Windows.Storage.Search.SortEntry[]): void; - reverse(): Windows.Storage.Search.SortEntry[]; - shift(): Windows.Storage.Search.SortEntry; - slice(start: number): Windows.Storage.Search.SortEntry[]; - slice(start: number, end: number): Windows.Storage.Search.SortEntry[]; - sort(): Windows.Storage.Search.SortEntry[]; - sort(compareFn: (a: Windows.Storage.Search.SortEntry, b: Windows.Storage.Search.SortEntry) => number): Windows.Storage.Search.SortEntry[]; - splice(start: number): Windows.Storage.Search.SortEntry[]; - splice(start: number, deleteCount: number, ...items: Windows.Storage.Search.SortEntry[]): Windows.Storage.Search.SortEntry[]; - unshift(...items: Windows.Storage.Search.SortEntry[]): number; - lastIndexOf(searchElement: Windows.Storage.Search.SortEntry): number; - lastIndexOf(searchElement: Windows.Storage.Search.SortEntry, fromIndex: number): number; - every(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => boolean): boolean; - every(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => boolean): boolean; - some(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => void ): void; - forEach(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => void , thisArg: any): void; - map(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => any): any[]; - map(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => boolean): Windows.Storage.Search.SortEntry[]; - filter(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => boolean, thisArg: any): Windows.Storage.Search.SortEntry[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Storage.Search.SortEntry[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Storage.Search.SortEntry[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Storage.Search.SortEntry[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Storage.Search.SortEntry[]) => any, initialValue: any): any; - length: number; - } - } - } -} -declare module Windows { - export module Storage { - export module AccessCache { - export interface AccessListEntry { - token: string; - metadata: string; - } - export interface IItemRemovedEventArgs { - removedEntry: Windows.Storage.AccessCache.AccessListEntry; - } - export class AccessListEntryView implements Windows.Foundation.Collections.IVectorView, Windows.Foundation.Collections.IIterable { - size: number; - getAt(index: number): Windows.Storage.AccessCache.AccessListEntry; - indexOf(value: Windows.Storage.AccessCache.AccessListEntry): { index: number; returnValue: boolean; }; - getMany(startIndex: number): { items: Windows.Storage.AccessCache.AccessListEntry[]; returnValue: number; }; - first(): Windows.Foundation.Collections.IIterator; - toString(): string; - toLocaleString(): string; - concat(...items: Windows.Storage.AccessCache.AccessListEntry[][]): Windows.Storage.AccessCache.AccessListEntry[]; - join(seperator: string): string; - pop(): Windows.Storage.AccessCache.AccessListEntry; - push(...items: Windows.Storage.AccessCache.AccessListEntry[]): void; - reverse(): Windows.Storage.AccessCache.AccessListEntry[]; - shift(): Windows.Storage.AccessCache.AccessListEntry; - slice(start: number): Windows.Storage.AccessCache.AccessListEntry[]; - slice(start: number, end: number): Windows.Storage.AccessCache.AccessListEntry[]; - sort(): Windows.Storage.AccessCache.AccessListEntry[]; - sort(compareFn: (a: Windows.Storage.AccessCache.AccessListEntry, b: Windows.Storage.AccessCache.AccessListEntry) => number): Windows.Storage.AccessCache.AccessListEntry[]; - splice(start: number): Windows.Storage.AccessCache.AccessListEntry[]; - splice(start: number, deleteCount: number, ...items: Windows.Storage.AccessCache.AccessListEntry[]): Windows.Storage.AccessCache.AccessListEntry[]; - unshift(...items: Windows.Storage.AccessCache.AccessListEntry[]): number; - lastIndexOf(searchElement: Windows.Storage.AccessCache.AccessListEntry): number; - lastIndexOf(searchElement: Windows.Storage.AccessCache.AccessListEntry, fromIndex: number): number; - every(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => boolean): boolean; - every(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => boolean): boolean; - some(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => void ): void; - forEach(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => void , thisArg: any): void; - map(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => any): any[]; - map(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => boolean): Windows.Storage.AccessCache.AccessListEntry[]; - filter(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => boolean, thisArg: any): Windows.Storage.AccessCache.AccessListEntry[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => any, initialValue: any): any; - length: number; - } - export enum AccessCacheOptions { - none, - disallowUserInput, - fastLocationsOnly, - useReadOnlyCachedCopy, - suppressAccessTimeUpdate, - } - export interface IStorageItemAccessList { - entries: Windows.Storage.AccessCache.AccessListEntryView; - maximumItemsAllowed: number; - add(file: Windows.Storage.IStorageItem): string; - add(file: Windows.Storage.IStorageItem, metadata: string): string; - addOrReplace(token: string, file: Windows.Storage.IStorageItem): void; - addOrReplace(token: string, file: Windows.Storage.IStorageItem, metadata: string): void; - getItemAsync(token: string): Windows.Foundation.IAsyncOperation; - getFileAsync(token: string): Windows.Foundation.IAsyncOperation; - getFolderAsync(token: string): Windows.Foundation.IAsyncOperation; - getItemAsync(token: string, options: Windows.Storage.AccessCache.AccessCacheOptions): Windows.Foundation.IAsyncOperation; - getFileAsync(token: string, options: Windows.Storage.AccessCache.AccessCacheOptions): Windows.Foundation.IAsyncOperation; - getFolderAsync(token: string, options: Windows.Storage.AccessCache.AccessCacheOptions): Windows.Foundation.IAsyncOperation; - remove(token: string): void; - containsItem(token: string): boolean; - clear(): void; - checkAccess(file: Windows.Storage.IStorageItem): boolean; - } - export interface IStorageItemMostRecentlyUsedList extends Windows.Storage.AccessCache.IStorageItemAccessList { - onitemremoved: any/* TODO */; - } - export class StorageItemMostRecentlyUsedList implements Windows.Storage.AccessCache.IStorageItemMostRecentlyUsedList, Windows.Storage.AccessCache.IStorageItemAccessList { - entries: Windows.Storage.AccessCache.AccessListEntryView; - maximumItemsAllowed: number; - onitemremoved: any/* TODO */; - add(file: Windows.Storage.IStorageItem): string; - add(file: Windows.Storage.IStorageItem, metadata: string): string; - addOrReplace(token: string, file: Windows.Storage.IStorageItem): void; - addOrReplace(token: string, file: Windows.Storage.IStorageItem, metadata: string): void; - getItemAsync(token: string): Windows.Foundation.IAsyncOperation; - getFileAsync(token: string): Windows.Foundation.IAsyncOperation; - getFolderAsync(token: string): Windows.Foundation.IAsyncOperation; - getItemAsync(token: string, options: Windows.Storage.AccessCache.AccessCacheOptions): Windows.Foundation.IAsyncOperation; - getFileAsync(token: string, options: Windows.Storage.AccessCache.AccessCacheOptions): Windows.Foundation.IAsyncOperation; - getFolderAsync(token: string, options: Windows.Storage.AccessCache.AccessCacheOptions): Windows.Foundation.IAsyncOperation; - remove(token: string): void; - containsItem(token: string): boolean; - clear(): void; - checkAccess(file: Windows.Storage.IStorageItem): boolean; - } - export class ItemRemovedEventArgs implements Windows.Storage.AccessCache.IItemRemovedEventArgs { - removedEntry: Windows.Storage.AccessCache.AccessListEntry; - } - export interface IStorageApplicationPermissionsStatics { - futureAccessList: Windows.Storage.AccessCache.StorageItemAccessList; - mostRecentlyUsedList: Windows.Storage.AccessCache.StorageItemMostRecentlyUsedList; - } - export class StorageItemAccessList implements Windows.Storage.AccessCache.IStorageItemAccessList { - entries: Windows.Storage.AccessCache.AccessListEntryView; - maximumItemsAllowed: number; - add(file: Windows.Storage.IStorageItem): string; - add(file: Windows.Storage.IStorageItem, metadata: string): string; - addOrReplace(token: string, file: Windows.Storage.IStorageItem): void; - addOrReplace(token: string, file: Windows.Storage.IStorageItem, metadata: string): void; - getItemAsync(token: string): Windows.Foundation.IAsyncOperation; - getFileAsync(token: string): Windows.Foundation.IAsyncOperation; - getFolderAsync(token: string): Windows.Foundation.IAsyncOperation; - getItemAsync(token: string, options: Windows.Storage.AccessCache.AccessCacheOptions): Windows.Foundation.IAsyncOperation; - getFileAsync(token: string, options: Windows.Storage.AccessCache.AccessCacheOptions): Windows.Foundation.IAsyncOperation; - getFolderAsync(token: string, options: Windows.Storage.AccessCache.AccessCacheOptions): Windows.Foundation.IAsyncOperation; - remove(token: string): void; - containsItem(token: string): boolean; - clear(): void; - checkAccess(file: Windows.Storage.IStorageItem): boolean; - } - export class StorageApplicationPermissions { - static futureAccessList: Windows.Storage.AccessCache.StorageItemAccessList; - static mostRecentlyUsedList: Windows.Storage.AccessCache.StorageItemMostRecentlyUsedList; - } - } - } -} -declare module Windows { - export module Storage { - export module BulkAccess { - export interface IStorageItemInformation { - basicProperties: Windows.Storage.FileProperties.BasicProperties; - documentProperties: Windows.Storage.FileProperties.DocumentProperties; - imageProperties: Windows.Storage.FileProperties.ImageProperties; - musicProperties: Windows.Storage.FileProperties.MusicProperties; - thumbnail: Windows.Storage.FileProperties.StorageItemThumbnail; - videoProperties: Windows.Storage.FileProperties.VideoProperties; - onthumbnailupdated: any/* TODO */; - onpropertiesupdated: any/* TODO */; - } - export interface IFileInformationFactoryFactory { - createWithMode(queryResult: Windows.Storage.Search.IStorageQueryResultBase, mode: Windows.Storage.FileProperties.ThumbnailMode): Windows.Storage.BulkAccess.FileInformationFactory; - createWithModeAndSize(queryResult: Windows.Storage.Search.IStorageQueryResultBase, mode: Windows.Storage.FileProperties.ThumbnailMode, requestedThumbnailSize: number): Windows.Storage.BulkAccess.FileInformationFactory; - createWithModeAndSizeAndOptions(queryResult: Windows.Storage.Search.IStorageQueryResultBase, mode: Windows.Storage.FileProperties.ThumbnailMode, requestedThumbnailSize: number, thumbnailOptions: Windows.Storage.FileProperties.ThumbnailOptions): Windows.Storage.BulkAccess.FileInformationFactory; - createWithModeAndSizeAndOptionsAndFlags(queryResult: Windows.Storage.Search.IStorageQueryResultBase, mode: Windows.Storage.FileProperties.ThumbnailMode, requestedThumbnailSize: number, thumbnailOptions: Windows.Storage.FileProperties.ThumbnailOptions, delayLoad: boolean): Windows.Storage.BulkAccess.FileInformationFactory; - } - export class FileInformationFactory implements Windows.Storage.BulkAccess.IFileInformationFactory { - constructor(queryResult: Windows.Storage.Search.IStorageQueryResultBase, mode: Windows.Storage.FileProperties.ThumbnailMode); - constructor(queryResult: Windows.Storage.Search.IStorageQueryResultBase, mode: Windows.Storage.FileProperties.ThumbnailMode, requestedThumbnailSize: number); - constructor(queryResult: Windows.Storage.Search.IStorageQueryResultBase, mode: Windows.Storage.FileProperties.ThumbnailMode, requestedThumbnailSize: number, thumbnailOptions: Windows.Storage.FileProperties.ThumbnailOptions); - constructor(queryResult: Windows.Storage.Search.IStorageQueryResultBase, mode: Windows.Storage.FileProperties.ThumbnailMode, requestedThumbnailSize: number, thumbnailOptions: Windows.Storage.FileProperties.ThumbnailOptions, delayLoad: boolean); - getItemsAsync(startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - getItemsAsync(): Windows.Foundation.IAsyncOperation>; - getFilesAsync(startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - getFilesAsync(): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(): Windows.Foundation.IAsyncOperation>; - getVirtualizedItemsVector(): any; - getVirtualizedFilesVector(): any; - getVirtualizedFoldersVector(): any; - } - export interface IFileInformationFactory { - getItemsAsync(startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - getItemsAsync(): Windows.Foundation.IAsyncOperation>; - getFilesAsync(startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - getFilesAsync(): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(): Windows.Foundation.IAsyncOperation>; - getVirtualizedItemsVector(): any; - getVirtualizedFilesVector(): any; - getVirtualizedFoldersVector(): any; - } - export class FileInformation implements Windows.Storage.BulkAccess.IStorageItemInformation, Windows.Storage.IStorageFile, Windows.Storage.IStorageItem, Windows.Storage.Streams.IRandomAccessStreamReference, Windows.Storage.Streams.IInputStreamReference, Windows.Storage.IStorageItemProperties { - basicProperties: Windows.Storage.FileProperties.BasicProperties; - documentProperties: Windows.Storage.FileProperties.DocumentProperties; - imageProperties: Windows.Storage.FileProperties.ImageProperties; - musicProperties: Windows.Storage.FileProperties.MusicProperties; - thumbnail: Windows.Storage.FileProperties.StorageItemThumbnail; - videoProperties: Windows.Storage.FileProperties.VideoProperties; - contentType: string; - fileType: string; - attributes: Windows.Storage.FileAttributes; - dateCreated: Date; - name: string; - path: string; - displayName: string; - displayType: string; - folderRelativeId: string; - properties: Windows.Storage.FileProperties.StorageItemContentProperties; - onthumbnailupdated: any/* TODO */; - onpropertiesupdated: any/* TODO */; - openAsync(accessMode: Windows.Storage.FileAccessMode): Windows.Foundation.IAsyncOperation; - openTransactedWriteAsync(): Windows.Foundation.IAsyncOperation; - copyAsync(destinationFolder: Windows.Storage.IStorageFolder): Windows.Foundation.IAsyncOperation; - copyAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string): Windows.Foundation.IAsyncOperation; - copyAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncOperation; - copyAndReplaceAsync(fileToReplace: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - moveAsync(destinationFolder: Windows.Storage.IStorageFolder): Windows.Foundation.IAsyncAction; - moveAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string): Windows.Foundation.IAsyncAction; - moveAsync(destinationFolder: Windows.Storage.IStorageFolder, desiredNewName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncAction; - moveAndReplaceAsync(fileToReplace: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - renameAsync(desiredName: string): Windows.Foundation.IAsyncAction; - renameAsync(desiredName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncAction; - deleteAsync(): Windows.Foundation.IAsyncAction; - deleteAsync(option: Windows.Storage.StorageDeleteOption): Windows.Foundation.IAsyncAction; - getBasicPropertiesAsync(): Windows.Foundation.IAsyncOperation; - isOfType(type: Windows.Storage.StorageItemTypes): boolean; - openReadAsync(): Windows.Foundation.IAsyncOperation; - openSequentialReadAsync(): Windows.Foundation.IAsyncOperation; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode): Windows.Foundation.IAsyncOperation; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode, requestedSize: number): Windows.Foundation.IAsyncOperation; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode, requestedSize: number, options: Windows.Storage.FileProperties.ThumbnailOptions): Windows.Foundation.IAsyncOperation; - } - export class FolderInformation implements Windows.Storage.BulkAccess.IStorageItemInformation, Windows.Storage.IStorageFolder, Windows.Storage.IStorageItem, Windows.Storage.IStorageItemProperties, Windows.Storage.Search.IStorageFolderQueryOperations { - basicProperties: Windows.Storage.FileProperties.BasicProperties; - documentProperties: Windows.Storage.FileProperties.DocumentProperties; - imageProperties: Windows.Storage.FileProperties.ImageProperties; - musicProperties: Windows.Storage.FileProperties.MusicProperties; - thumbnail: Windows.Storage.FileProperties.StorageItemThumbnail; - videoProperties: Windows.Storage.FileProperties.VideoProperties; - attributes: Windows.Storage.FileAttributes; - dateCreated: Date; - name: string; - path: string; - displayName: string; - displayType: string; - folderRelativeId: string; - properties: Windows.Storage.FileProperties.StorageItemContentProperties; - onthumbnailupdated: any/* TODO */; - onpropertiesupdated: any/* TODO */; - createFileAsync(desiredName: string): Windows.Foundation.IAsyncOperation; - createFileAsync(desiredName: string, options: Windows.Storage.CreationCollisionOption): Windows.Foundation.IAsyncOperation; - createFolderAsync(desiredName: string): Windows.Foundation.IAsyncOperation; - createFolderAsync(desiredName: string, options: Windows.Storage.CreationCollisionOption): Windows.Foundation.IAsyncOperation; - getFileAsync(name: string): Windows.Foundation.IAsyncOperation; - getFolderAsync(name: string): Windows.Foundation.IAsyncOperation; - getItemAsync(name: string): Windows.Foundation.IAsyncOperation; - getFilesAsync(): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(): Windows.Foundation.IAsyncOperation>; - getItemsAsync(): Windows.Foundation.IAsyncOperation>; - renameAsync(desiredName: string): Windows.Foundation.IAsyncAction; - renameAsync(desiredName: string, option: Windows.Storage.NameCollisionOption): Windows.Foundation.IAsyncAction; - deleteAsync(): Windows.Foundation.IAsyncAction; - deleteAsync(option: Windows.Storage.StorageDeleteOption): Windows.Foundation.IAsyncAction; - getBasicPropertiesAsync(): Windows.Foundation.IAsyncOperation; - isOfType(type: Windows.Storage.StorageItemTypes): boolean; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode): Windows.Foundation.IAsyncOperation; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode, requestedSize: number): Windows.Foundation.IAsyncOperation; - getThumbnailAsync(mode: Windows.Storage.FileProperties.ThumbnailMode, requestedSize: number, options: Windows.Storage.FileProperties.ThumbnailOptions): Windows.Foundation.IAsyncOperation; - getIndexedStateAsync(): Windows.Foundation.IAsyncOperation; - createFileQuery(): Windows.Storage.Search.StorageFileQueryResult; - createFileQuery(query: Windows.Storage.Search.CommonFileQuery): Windows.Storage.Search.StorageFileQueryResult; - createFileQueryWithOptions(queryOptions: Windows.Storage.Search.QueryOptions): Windows.Storage.Search.StorageFileQueryResult; - createFolderQuery(): Windows.Storage.Search.StorageFolderQueryResult; - createFolderQuery(query: Windows.Storage.Search.CommonFolderQuery): Windows.Storage.Search.StorageFolderQueryResult; - createFolderQueryWithOptions(queryOptions: Windows.Storage.Search.QueryOptions): Windows.Storage.Search.StorageFolderQueryResult; - createItemQuery(): Windows.Storage.Search.StorageItemQueryResult; - createItemQueryWithOptions(queryOptions: Windows.Storage.Search.QueryOptions): Windows.Storage.Search.StorageItemQueryResult; - getFilesAsync(query: Windows.Storage.Search.CommonFileQuery, startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - getFilesAsync(query: Windows.Storage.Search.CommonFileQuery): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(query: Windows.Storage.Search.CommonFolderQuery, startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - getFoldersAsync(query: Windows.Storage.Search.CommonFolderQuery): Windows.Foundation.IAsyncOperation>; - getItemsAsync(startIndex: number, maxItemsToRetrieve: number): Windows.Foundation.IAsyncOperation>; - areQueryOptionsSupported(queryOptions: Windows.Storage.Search.QueryOptions): boolean; - isCommonFolderQuerySupported(query: Windows.Storage.Search.CommonFolderQuery): boolean; - isCommonFileQuerySupported(query: Windows.Storage.Search.CommonFileQuery): boolean; - } - } - } -} -declare module Windows { - export module Storage { - export module Pickers { - export enum PickerViewMode { - list, - thumbnail, - } - export enum PickerLocationId { - documentsLibrary, - computerFolder, - desktop, - downloads, - homeGroup, - musicLibrary, - picturesLibrary, - videosLibrary, - } - export class FilePickerSelectedFilesArray implements Windows.Foundation.Collections.IVectorView, Windows.Foundation.Collections.IIterable { - size: number; - getAt(index: number): Windows.Storage.StorageFile; - indexOf(value: Windows.Storage.StorageFile): { index: number; returnValue: boolean; }; - getMany(startIndex: number): { items: Windows.Storage.StorageFile[]; returnValue: number; }; - first(): Windows.Foundation.Collections.IIterator; - toString(): string; - toLocaleString(): string; - concat(...items: Windows.Storage.StorageFile[][]): Windows.Storage.StorageFile[]; - join(seperator: string): string; - pop(): Windows.Storage.StorageFile; - push(...items: Windows.Storage.StorageFile[]): void; - reverse(): Windows.Storage.StorageFile[]; - shift(): Windows.Storage.StorageFile; - slice(start: number): Windows.Storage.StorageFile[]; - slice(start: number, end: number): Windows.Storage.StorageFile[]; - sort(): Windows.Storage.StorageFile[]; - sort(compareFn: (a: Windows.Storage.StorageFile, b: Windows.Storage.StorageFile) => number): Windows.Storage.StorageFile[]; - splice(start: number): Windows.Storage.StorageFile[]; - splice(start: number, deleteCount: number, ...items: Windows.Storage.StorageFile[]): Windows.Storage.StorageFile[]; - unshift(...items: Windows.Storage.StorageFile[]): number; - lastIndexOf(searchElement: Windows.Storage.StorageFile): number; - lastIndexOf(searchElement: Windows.Storage.StorageFile, fromIndex: number): number; - every(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => boolean): boolean; - every(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => boolean): boolean; - some(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => void ): void; - forEach(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => void , thisArg: any): void; - map(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => any): any[]; - map(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => boolean): Windows.Storage.StorageFile[]; - filter(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => boolean, thisArg: any): Windows.Storage.StorageFile[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Storage.StorageFile[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Storage.StorageFile[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Storage.StorageFile[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Storage.StorageFile[]) => any, initialValue: any): any; - length: number; - } - export class FilePickerFileTypesOrderedMap implements Windows.Foundation.Collections.IMap>, Windows.Foundation.Collections.IIterable>> { - size: number; - lookup(key: string): Windows.Foundation.Collections.IVector; - hasKey(key: string): boolean; - getView(): Windows.Foundation.Collections.IMapView>; - insert(key: string, value: Windows.Foundation.Collections.IVector): boolean; - remove(key: string): void; - clear(): void; - first(): Windows.Foundation.Collections.IIterator>>; - } - export class FileExtensionVector implements Windows.Foundation.Collections.IVector, Windows.Foundation.Collections.IIterable { - size: number; - getAt(index: number): string; - getView(): Windows.Foundation.Collections.IVectorView; - indexOf(value: string): { index: number; returnValue: boolean; }; - setAt(index: number, value: string): void; - insertAt(index: number, value: string): void; - removeAt(index: number): void; - append(value: string): void; - removeAtEnd(): void; - clear(): void; - getMany(startIndex: number): { items: string[]; returnValue: number; }; - replaceAll(items: string[]): void; - first(): Windows.Foundation.Collections.IIterator; - toString(): string; - toLocaleString(): string; - concat(...items: string[][]): string[]; - join(seperator: string): string; - pop(): string; - push(...items: string[]): void; - reverse(): string[]; - shift(): string; - slice(start: number): string[]; - slice(start: number, end: number): string[]; - sort(): string[]; - sort(compareFn: (a: string, b: string) => number): string[]; - splice(start: number): string[]; - splice(start: number, deleteCount: number, ...items: string[]): string[]; - unshift(...items: string[]): number; - lastIndexOf(searchElement: string): number; - lastIndexOf(searchElement: string, fromIndex: number): number; - every(callbackfn: (value: string, index: number, array: string[]) => boolean): boolean; - every(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg: any): boolean; - some(callbackfn: (value: string, index: number, array: string[]) => boolean): boolean; - some(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: string, index: number, array: string[]) => void ): void; - forEach(callbackfn: (value: string, index: number, array: string[]) => void , thisArg: any): void; - map(callbackfn: (value: string, index: number, array: string[]) => any): any[]; - map(callbackfn: (value: string, index: number, array: string[]) => any, thisArg: any): any[]; - filter(callbackfn: (value: string, index: number, array: string[]) => boolean): string[]; - filter(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg: any): string[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any): any; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue: any): any; - length: number; - } - export interface IFileOpenPicker { - commitButtonText: string; - fileTypeFilter: Windows.Foundation.Collections.IVector; - settingsIdentifier: string; - suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; - viewMode: Windows.Storage.Pickers.PickerViewMode; - pickSingleFileAsync(): Windows.Foundation.IAsyncOperation; - pickMultipleFilesAsync(): Windows.Foundation.IAsyncOperation>; - } - export interface IFileSavePicker { - commitButtonText: string; - defaultFileExtension: string; - fileTypeChoices: Windows.Foundation.Collections.IMap>; - settingsIdentifier: string; - suggestedFileName: string; - suggestedSaveFile: Windows.Storage.StorageFile; - suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; - pickSaveFileAsync(): Windows.Foundation.IAsyncOperation; - } - export interface IFolderPicker { - commitButtonText: string; - fileTypeFilter: Windows.Foundation.Collections.IVector; - settingsIdentifier: string; - suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; - viewMode: Windows.Storage.Pickers.PickerViewMode; - pickSingleFolderAsync(): Windows.Foundation.IAsyncOperation; - } - export class FileOpenPicker implements Windows.Storage.Pickers.IFileOpenPicker { - commitButtonText: string; - fileTypeFilter: Windows.Foundation.Collections.IVector; - settingsIdentifier: string; - suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; - viewMode: Windows.Storage.Pickers.PickerViewMode; - pickSingleFileAsync(): Windows.Foundation.IAsyncOperation; - pickMultipleFilesAsync(): Windows.Foundation.IAsyncOperation>; - } - export class FileSavePicker implements Windows.Storage.Pickers.IFileSavePicker { - commitButtonText: string; - defaultFileExtension: string; - fileTypeChoices: Windows.Foundation.Collections.IMap>; - settingsIdentifier: string; - suggestedFileName: string; - suggestedSaveFile: Windows.Storage.StorageFile; - suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; - pickSaveFileAsync(): Windows.Foundation.IAsyncOperation; - } - export class FolderPicker implements Windows.Storage.Pickers.IFolderPicker { - commitButtonText: string; - fileTypeFilter: Windows.Foundation.Collections.IVector; - settingsIdentifier: string; - suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; - viewMode: Windows.Storage.Pickers.PickerViewMode; - pickSingleFolderAsync(): Windows.Foundation.IAsyncOperation; - } - } - } -} -declare module Windows { - export module Storage { - export module Compression { - export enum CompressAlgorithm { - invalidAlgorithm, - nullAlgorithm, - mszip, - xpress, - xpressHuff, - lzms, - } - export interface ICompressor extends Windows.Storage.Streams.IOutputStream, Windows.Foundation.IClosable { - finishAsync(): Windows.Foundation.IAsyncOperation; - detachStream(): Windows.Storage.Streams.IOutputStream; - } - export class Compressor implements Windows.Storage.Compression.ICompressor, Windows.Storage.Streams.IOutputStream, Windows.Foundation.IClosable { - constructor(underlyingStream: Windows.Storage.Streams.IOutputStream); - constructor(underlyingStream: Windows.Storage.Streams.IOutputStream, algorithm: Windows.Storage.Compression.CompressAlgorithm, blockSize: number); - finishAsync(): Windows.Foundation.IAsyncOperation; - detachStream(): Windows.Storage.Streams.IOutputStream; - writeAsync(buffer: Windows.Storage.Streams.IBuffer): Windows.Foundation.IAsyncOperationWithProgress; - flushAsync(): Windows.Foundation.IAsyncOperation; - dispose(): void; - close(): void; - } - export interface IDecompressor extends Windows.Storage.Streams.IInputStream, Windows.Foundation.IClosable { - detachStream(): Windows.Storage.Streams.IInputStream; - } - export class Decompressor implements Windows.Storage.Compression.IDecompressor, Windows.Storage.Streams.IInputStream, Windows.Foundation.IClosable { - constructor(underlyingStream: Windows.Storage.Streams.IInputStream); - detachStream(): Windows.Storage.Streams.IInputStream; - readAsync(buffer: Windows.Storage.Streams.IBuffer, count: number, options: Windows.Storage.Streams.InputStreamOptions): Windows.Foundation.IAsyncOperationWithProgress; - dispose(): void; - close(): void; - } - export interface ICompressorFactory { - createCompressor(underlyingStream: Windows.Storage.Streams.IOutputStream): Windows.Storage.Compression.Compressor; - createCompressorEx(underlyingStream: Windows.Storage.Streams.IOutputStream, algorithm: Windows.Storage.Compression.CompressAlgorithm, blockSize: number): Windows.Storage.Compression.Compressor; - } - export interface IDecompressorFactory { - createDecompressor(underlyingStream: Windows.Storage.Streams.IInputStream): Windows.Storage.Compression.Decompressor; - } - } - } -} -declare module Windows { - export module System { - export module Profile { - export interface IHardwareToken { - certificate: Windows.Storage.Streams.IBuffer; - id: Windows.Storage.Streams.IBuffer; - signature: Windows.Storage.Streams.IBuffer; - } - export class HardwareToken implements Windows.System.Profile.IHardwareToken { - certificate: Windows.Storage.Streams.IBuffer; - id: Windows.Storage.Streams.IBuffer; - signature: Windows.Storage.Streams.IBuffer; - } - export interface IHardwareIdentificationStatics { - getPackageSpecificToken(nonce: Windows.Storage.Streams.IBuffer): Windows.System.Profile.HardwareToken; - } - export class HardwareIdentification { - static getPackageSpecificToken(nonce: Windows.Storage.Streams.IBuffer): Windows.System.Profile.HardwareToken; - } - } - } -} -declare module Windows { - export module System { - export module Threading { - export enum WorkItemPriority { - low, - normal, - high, - } - export enum WorkItemOptions { - none, - timeSliced, - } - export interface TimerElapsedHandler { - (timer: Windows.System.Threading.ThreadPoolTimer): void; - } - export class ThreadPoolTimer implements Windows.System.Threading.IThreadPoolTimer { - delay: number; - period: number; - cancel(): void; - static createPeriodicTimer(handler: Windows.System.Threading.TimerElapsedHandler, period: number): Windows.System.Threading.ThreadPoolTimer; - static createTimer(handler: Windows.System.Threading.TimerElapsedHandler, delay: number): Windows.System.Threading.ThreadPoolTimer; - static createPeriodicTimer(handler: Windows.System.Threading.TimerElapsedHandler, period: number, destroyed: Windows.System.Threading.TimerDestroyedHandler): Windows.System.Threading.ThreadPoolTimer; - static createTimer(handler: Windows.System.Threading.TimerElapsedHandler, delay: number, destroyed: Windows.System.Threading.TimerDestroyedHandler): Windows.System.Threading.ThreadPoolTimer; - } - export interface TimerDestroyedHandler { - (timer: Windows.System.Threading.ThreadPoolTimer): void; - } - export interface WorkItemHandler { - (operation: Windows.Foundation.IAsyncAction): void; - } - export interface IThreadPoolStatics { - runAsync(handler: Windows.System.Threading.WorkItemHandler): Windows.Foundation.IAsyncAction; - runAsync(handler: Windows.System.Threading.WorkItemHandler, priority: Windows.System.Threading.WorkItemPriority): Windows.Foundation.IAsyncAction; - runAsync(handler: Windows.System.Threading.WorkItemHandler, priority: Windows.System.Threading.WorkItemPriority, options: Windows.System.Threading.WorkItemOptions): Windows.Foundation.IAsyncAction; - } - export interface IThreadPoolTimer { - delay: number; - period: number; - cancel(): void; - } - export interface IThreadPoolTimerStatics { - createPeriodicTimer(handler: Windows.System.Threading.TimerElapsedHandler, period: number): Windows.System.Threading.ThreadPoolTimer; - createTimer(handler: Windows.System.Threading.TimerElapsedHandler, delay: number): Windows.System.Threading.ThreadPoolTimer; - createPeriodicTimer(handler: Windows.System.Threading.TimerElapsedHandler, period: number, destroyed: Windows.System.Threading.TimerDestroyedHandler): Windows.System.Threading.ThreadPoolTimer; - createTimer(handler: Windows.System.Threading.TimerElapsedHandler, delay: number, destroyed: Windows.System.Threading.TimerDestroyedHandler): Windows.System.Threading.ThreadPoolTimer; - } - export class ThreadPool { - static runAsync(handler: Windows.System.Threading.WorkItemHandler): Windows.Foundation.IAsyncAction; - static runAsync(handler: Windows.System.Threading.WorkItemHandler, priority: Windows.System.Threading.WorkItemPriority): Windows.Foundation.IAsyncAction; - static runAsync(handler: Windows.System.Threading.WorkItemHandler, priority: Windows.System.Threading.WorkItemPriority, options: Windows.System.Threading.WorkItemOptions): Windows.Foundation.IAsyncAction; - } - } - } -} -declare module Windows { - export module System { - export module Threading { - export module Core { - export interface SignalHandler { - (signalNotifier: Windows.System.Threading.Core.SignalNotifier, timedOut: boolean): void; - } - export class SignalNotifier implements Windows.System.Threading.Core.ISignalNotifier { - enable(): void; - terminate(): void; - static attachToEvent(name: string, handler: Windows.System.Threading.Core.SignalHandler): Windows.System.Threading.Core.SignalNotifier; - static attachToEvent(name: string, handler: Windows.System.Threading.Core.SignalHandler, timeout: number): Windows.System.Threading.Core.SignalNotifier; - static attachToSemaphore(name: string, handler: Windows.System.Threading.Core.SignalHandler): Windows.System.Threading.Core.SignalNotifier; - static attachToSemaphore(name: string, handler: Windows.System.Threading.Core.SignalHandler, timeout: number): Windows.System.Threading.Core.SignalNotifier; - } - export interface ISignalNotifierStatics { - attachToEvent(name: string, handler: Windows.System.Threading.Core.SignalHandler): Windows.System.Threading.Core.SignalNotifier; - attachToEvent(name: string, handler: Windows.System.Threading.Core.SignalHandler, timeout: number): Windows.System.Threading.Core.SignalNotifier; - attachToSemaphore(name: string, handler: Windows.System.Threading.Core.SignalHandler): Windows.System.Threading.Core.SignalNotifier; - attachToSemaphore(name: string, handler: Windows.System.Threading.Core.SignalHandler, timeout: number): Windows.System.Threading.Core.SignalNotifier; - } - export interface IPreallocatedWorkItemFactory { - createWorkItem(handler: Windows.System.Threading.WorkItemHandler): Windows.System.Threading.Core.PreallocatedWorkItem; - createWorkItemWithPriority(handler: Windows.System.Threading.WorkItemHandler, priority: Windows.System.Threading.WorkItemPriority): Windows.System.Threading.Core.PreallocatedWorkItem; - createWorkItemWithPriorityAndOptions(handler: Windows.System.Threading.WorkItemHandler, priority: Windows.System.Threading.WorkItemPriority, options: Windows.System.Threading.WorkItemOptions): Windows.System.Threading.Core.PreallocatedWorkItem; - } - export class PreallocatedWorkItem implements Windows.System.Threading.Core.IPreallocatedWorkItem { - constructor(handler: Windows.System.Threading.WorkItemHandler); - constructor(handler: Windows.System.Threading.WorkItemHandler, priority: Windows.System.Threading.WorkItemPriority); - constructor(handler: Windows.System.Threading.WorkItemHandler, priority: Windows.System.Threading.WorkItemPriority, options: Windows.System.Threading.WorkItemOptions); - runAsync(): Windows.Foundation.IAsyncAction; - } - export interface IPreallocatedWorkItem { - runAsync(): Windows.Foundation.IAsyncAction; - } - export interface ISignalNotifier { - enable(): void; - terminate(): void; - } - } - } - } -} -declare module Windows { - export module System { - export module UserProfile { - export enum AccountPictureKind { - smallImage, - largeImage, - video, - } - export enum SetAccountPictureResult { - success, - changeDisabled, - largeOrDynamicError, - videoFrameSizeError, - fileSizeError, - failure, - } - export interface IUserInformationStatics { - accountPictureChangeEnabled: boolean; - nameAccessAllowed: boolean; - getAccountPicture(kind: Windows.System.UserProfile.AccountPictureKind): Windows.Storage.IStorageFile; - setAccountPictureAsync(image: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - setAccountPicturesAsync(smallImage: Windows.Storage.IStorageFile, largeImage: Windows.Storage.IStorageFile, video: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - setAccountPictureFromStreamAsync(image: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncOperation; - setAccountPicturesFromStreamsAsync(smallImage: Windows.Storage.Streams.IRandomAccessStream, largeImage: Windows.Storage.Streams.IRandomAccessStream, video: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncOperation; - onaccountpicturechanged: any/* TODO */; - getDisplayNameAsync(): Windows.Foundation.IAsyncOperation; - getFirstNameAsync(): Windows.Foundation.IAsyncOperation; - getLastNameAsync(): Windows.Foundation.IAsyncOperation; - getPrincipalNameAsync(): Windows.Foundation.IAsyncOperation; - getSessionInitiationProtocolUriAsync(): Windows.Foundation.IAsyncOperation; - getDomainNameAsync(): Windows.Foundation.IAsyncOperation; - } - export class UserInformation { - static accountPictureChangeEnabled: boolean; - static nameAccessAllowed: boolean; - static getAccountPicture(kind: Windows.System.UserProfile.AccountPictureKind): Windows.Storage.IStorageFile; - static setAccountPictureAsync(image: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - static setAccountPicturesAsync(smallImage: Windows.Storage.IStorageFile, largeImage: Windows.Storage.IStorageFile, video: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - static setAccountPictureFromStreamAsync(image: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncOperation; - static setAccountPicturesFromStreamsAsync(smallImage: Windows.Storage.Streams.IRandomAccessStream, largeImage: Windows.Storage.Streams.IRandomAccessStream, video: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncOperation; - static onaccountpicturechanged: any/* TODO */; - static getDisplayNameAsync(): Windows.Foundation.IAsyncOperation; - static getFirstNameAsync(): Windows.Foundation.IAsyncOperation; - static getLastNameAsync(): Windows.Foundation.IAsyncOperation; - static getPrincipalNameAsync(): Windows.Foundation.IAsyncOperation; - static getSessionInitiationProtocolUriAsync(): Windows.Foundation.IAsyncOperation; - static getDomainNameAsync(): Windows.Foundation.IAsyncOperation; - } - export interface ILockScreenStatics { - originalImageFile: Windows.Foundation.Uri; - getImageStream(): Windows.Storage.Streams.IRandomAccessStream; - setImageFileAsync(value: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - setImageStreamAsync(value: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncAction; - } - export class LockScreen { - static originalImageFile: Windows.Foundation.Uri; - static getImageStream(): Windows.Storage.Streams.IRandomAccessStream; - static setImageFileAsync(value: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncAction; - static setImageStreamAsync(value: Windows.Storage.Streams.IRandomAccessStream): Windows.Foundation.IAsyncAction; - } - export interface IGlobalizationPreferencesStatics { - calendars: Windows.Foundation.Collections.IVectorView; - clocks: Windows.Foundation.Collections.IVectorView; - currencies: Windows.Foundation.Collections.IVectorView; - homeGeographicRegion: string; - languages: Windows.Foundation.Collections.IVectorView; - weekStartsOn: Windows.Globalization.DayOfWeek; - } - export class GlobalizationPreferences { - static calendars: Windows.Foundation.Collections.IVectorView; - static clocks: Windows.Foundation.Collections.IVectorView; - static currencies: Windows.Foundation.Collections.IVectorView; - static homeGeographicRegion: string; - static languages: Windows.Foundation.Collections.IVectorView; - static weekStartsOn: Windows.Globalization.DayOfWeek; - } - } - } -} -declare module Windows { - export module System { - export interface ILauncherUIOptions { - invocationPoint: Windows.Foundation.Point; - preferredPlacement: Windows.UI.Popups.Placement; - selectionRect: Windows.Foundation.Rect; - } - export class LauncherUIOptions implements Windows.System.ILauncherUIOptions { - invocationPoint: Windows.Foundation.Point; - preferredPlacement: Windows.UI.Popups.Placement; - selectionRect: Windows.Foundation.Rect; - } - export interface ILauncherOptions { - contentType: string; - displayApplicationPicker: boolean; - fallbackUri: Windows.Foundation.Uri; - preferredApplicationDisplayName: string; - preferredApplicationPackageFamilyName: string; - treatAsUntrusted: boolean; - uI: Windows.System.LauncherUIOptions; - } - export class LauncherOptions implements Windows.System.ILauncherOptions { - contentType: string; - displayApplicationPicker: boolean; - fallbackUri: Windows.Foundation.Uri; - preferredApplicationDisplayName: string; - preferredApplicationPackageFamilyName: string; - treatAsUntrusted: boolean; - uI: Windows.System.LauncherUIOptions; - } - export interface ILauncherStatics { - launchFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - launchFileAsync(file: Windows.Storage.IStorageFile, options: Windows.System.LauncherOptions): Windows.Foundation.IAsyncOperation; - launchUriAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation; - launchUriAsync(uri: Windows.Foundation.Uri, options: Windows.System.LauncherOptions): Windows.Foundation.IAsyncOperation; - } - export class Launcher { - static launchFileAsync(file: Windows.Storage.IStorageFile): Windows.Foundation.IAsyncOperation; - static launchFileAsync(file: Windows.Storage.IStorageFile, options: Windows.System.LauncherOptions): Windows.Foundation.IAsyncOperation; - static launchUriAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperation; - static launchUriAsync(uri: Windows.Foundation.Uri, options: Windows.System.LauncherOptions): Windows.Foundation.IAsyncOperation; - } - export enum ProcessorArchitecture { - x86, - arm, - x64, - neutral, - unknown, - } - export enum VirtualKeyModifiers { - none, - control, - menu, - shift, - windows, - } - export enum VirtualKey { - none, - leftButton, - rightButton, - cancel, - middleButton, - xButton1, - xButton2, - back, - tab, - clear, - enter, - shift, - control, - menu, - pause, - capitalLock, - kana, - hangul, - junja, - final, - hanja, - kanji, - escape, - convert, - nonConvert, - accept, - modeChange, - space, - pageUp, - pageDown, - end, - home, - left, - up, - right, - down, - select, - print, - execute, - snapshot, - insert, - delete_, - help, - number0, - number1, - number2, - number3, - number4, - number5, - number6, - number7, - number8, - number9, - a, - b, - c, - d, - e, - f, - g, - h, - i, - j, - k, - l, - m, - n, - o, - p, - q, - r, - s, - t, - u, - v, - w, - x, - y, - z, - leftWindows, - rightWindows, - application, - sleep, - numberPad0, - numberPad1, - numberPad2, - numberPad3, - numberPad4, - numberPad5, - numberPad6, - numberPad7, - numberPad8, - numberPad9, - multiply, - add, - separator, - subtract, - decimal, - divide, - f1, - f2, - f3, - f4, - f5, - f6, - f7, - f8, - f9, - f10, - f11, - f12, - f13, - f14, - f15, - f16, - f17, - f18, - f19, - f20, - f21, - f22, - f23, - f24, - numberKeyLock, - scroll, - leftShift, - rightShift, - leftControl, - rightControl, - leftMenu, - rightMenu, - } - } -} -declare module Windows { - export module System { - export module Display { - export interface IDisplayRequest { - requestActive(): void; - requestRelease(): void; - } - export class DisplayRequest implements Windows.System.Display.IDisplayRequest { - requestActive(): void; - requestRelease(): void; - } - } - } -} -declare module Windows { - export module System { - export module RemoteDesktop { - export interface IInteractiveSessionStatics { - isRemote: boolean; - } - export class InteractiveSession { - static isRemote: boolean; - } - } - } -} -declare module Windows { - export module UI { - export module ApplicationSettings { - export interface ISettingsCommandFactory { - create(settingsCommandId: any, label: string, handler: Windows.UI.Popups.UICommandInvokedHandler): Windows.UI.ApplicationSettings.SettingsCommand; - } - export class SettingsCommand implements Windows.UI.Popups.IUICommand { - constructor(settingsCommandId: any, label: string, handler: Windows.UI.Popups.UICommandInvokedHandler); - id: any; - invoked: Windows.UI.Popups.UICommandInvokedHandler; - label: string; - } - export interface ISettingsPaneCommandsRequest { - applicationCommands: Windows.Foundation.Collections.IVector; - } - export class SettingsPaneCommandsRequest implements Windows.UI.ApplicationSettings.ISettingsPaneCommandsRequest { - applicationCommands: Windows.Foundation.Collections.IVector; - } - export interface ISettingsPaneCommandsRequestedEventArgs { - request: Windows.UI.ApplicationSettings.SettingsPaneCommandsRequest; - } - export class SettingsPaneCommandsRequestedEventArgs implements Windows.UI.ApplicationSettings.ISettingsPaneCommandsRequestedEventArgs { - request: Windows.UI.ApplicationSettings.SettingsPaneCommandsRequest; - } - export enum SettingsEdgeLocation { - right, - left, - } - export interface ISettingsPaneStatics { - edge: Windows.UI.ApplicationSettings.SettingsEdgeLocation; - getForCurrentView(): Windows.UI.ApplicationSettings.SettingsPane; - show(): void; - } - export class SettingsPane implements Windows.UI.ApplicationSettings.ISettingsPane { - oncommandsrequested: any/* TODO */; - static edge: Windows.UI.ApplicationSettings.SettingsEdgeLocation; - static getForCurrentView(): Windows.UI.ApplicationSettings.SettingsPane; - static show(): void; - } - export interface ISettingsPane { - oncommandsrequested: any/* TODO */; - } - } - } -} -declare module Windows { - export module UI { - export module ViewManagement { - export enum ApplicationViewState { - fullScreenLandscape, - filled, - snapped, - fullScreenPortrait, - } - export interface IApplicationViewStatics { - value: Windows.UI.ViewManagement.ApplicationViewState; - tryUnsnap(): boolean; - } - export class ApplicationView { - static value: Windows.UI.ViewManagement.ApplicationViewState; - static tryUnsnap(): boolean; - } - export interface IInputPaneVisibilityEventArgs { - ensuredFocusedElementInView: boolean; - occludedRect: Windows.Foundation.Rect; - } - export class InputPaneVisibilityEventArgs implements Windows.UI.ViewManagement.IInputPaneVisibilityEventArgs { - ensuredFocusedElementInView: boolean; - occludedRect: Windows.Foundation.Rect; - } - export interface IInputPane { - occludedRect: Windows.Foundation.Rect; - onshowing: any/* TODO */; - onhiding: any/* TODO */; - } - export class InputPane implements Windows.UI.ViewManagement.IInputPane { - occludedRect: Windows.Foundation.Rect; - onshowing: any/* TODO */; - onhiding: any/* TODO */; - static getForCurrentView(): Windows.UI.ViewManagement.InputPane; - } - export interface IInputPaneStatics { - getForCurrentView(): Windows.UI.ViewManagement.InputPane; - } - export enum HandPreference { - leftHanded, - rightHanded, - } - export enum UIElementType { - activeCaption, - background, - buttonFace, - buttonText, - captionText, - grayText, - highlight, - highlightText, - hotlight, - inactiveCaption, - inactiveCaptionText, - window, - windowText, - } - export interface IAccessibilitySettings { - highContrast: boolean; - highContrastScheme: string; - onhighcontrastchanged: any/* TODO */; - } - export class AccessibilitySettings implements Windows.UI.ViewManagement.IAccessibilitySettings { - highContrast: boolean; - highContrastScheme: string; - onhighcontrastchanged: any/* TODO */; - } - export interface IUISettings { - animationsEnabled: boolean; - caretBlinkRate: number; - caretBrowsingEnabled: boolean; - caretWidth: number; - cursorSize: Windows.Foundation.Size; - doubleClickTime: number; - handPreference: Windows.UI.ViewManagement.HandPreference; - messageDuration: number; - mouseHoverTime: number; - scrollBarArrowSize: Windows.Foundation.Size; - scrollBarSize: Windows.Foundation.Size; - scrollBarThumbBoxSize: Windows.Foundation.Size; - uIElementColor(desiredElement: Windows.UI.ViewManagement.UIElementType): Windows.UI.Color; - } - export class UISettings implements Windows.UI.ViewManagement.IUISettings { - animationsEnabled: boolean; - caretBlinkRate: number; - caretBrowsingEnabled: boolean; - caretWidth: number; - cursorSize: Windows.Foundation.Size; - doubleClickTime: number; - handPreference: Windows.UI.ViewManagement.HandPreference; - messageDuration: number; - mouseHoverTime: number; - scrollBarArrowSize: Windows.Foundation.Size; - scrollBarSize: Windows.Foundation.Size; - scrollBarThumbBoxSize: Windows.Foundation.Size; - uIElementColor(desiredElement: Windows.UI.ViewManagement.UIElementType): Windows.UI.Color; - } - } - } -} -declare module Windows { - export module UI { - export module Input { - export enum EdgeGestureKind { - touch, - keyboard, - mouse, - } - export interface IEdgeGestureEventArgs { - kind: Windows.UI.Input.EdgeGestureKind; - } - export class EdgeGestureEventArgs implements Windows.UI.Input.IEdgeGestureEventArgs { - kind: Windows.UI.Input.EdgeGestureKind; - } - export interface IEdgeGestureStatics { - getForCurrentView(): Windows.UI.Input.EdgeGesture; - } - export class EdgeGesture implements Windows.UI.Input.IEdgeGesture { - onstarting: any/* TODO */; - oncompleted: any/* TODO */; - oncanceled: any/* TODO */; - static getForCurrentView(): Windows.UI.Input.EdgeGesture; - } - export interface IEdgeGesture { - onstarting: any/* TODO */; - oncompleted: any/* TODO */; - oncanceled: any/* TODO */; - } - export enum HoldingState { - started, - completed, - canceled, - } - export enum DraggingState { - started, - continuing, - completed, - } - export enum CrossSlidingState { - started, - dragging, - selecting, - selectSpeedBumping, - speedBumping, - rearranging, - completed, - } - export enum GestureSettings { - none, - tap, - doubleTap, - hold, - holdWithMouse, - rightTap, - drag, - manipulationTranslateX, - manipulationTranslateY, - manipulationTranslateRailsX, - manipulationTranslateRailsY, - manipulationRotate, - manipulationScale, - manipulationTranslateInertia, - manipulationRotateInertia, - manipulationScaleInertia, - crossSlide, - } - export interface ManipulationDelta { - translation: Windows.Foundation.Point; - scale: number; - rotation: number; - expansion: number; - } - export interface ManipulationVelocities { - linear: Windows.Foundation.Point; - angular: number; - expansion: number; - } - export interface CrossSlideThresholds { - selectionStart: number; - speedBumpStart: number; - speedBumpEnd: number; - rearrangeStart: number; - } - export interface ITappedEventArgs { - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - tapCount: number; - } - export interface IRightTappedEventArgs { - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - } - export interface IHoldingEventArgs { - holdingState: Windows.UI.Input.HoldingState; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - } - export interface IDraggingEventArgs { - draggingState: Windows.UI.Input.DraggingState; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - } - export interface IManipulationStartedEventArgs { - cumulative: Windows.UI.Input.ManipulationDelta; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - } - export interface IManipulationUpdatedEventArgs { - cumulative: Windows.UI.Input.ManipulationDelta; - delta: Windows.UI.Input.ManipulationDelta; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - velocities: Windows.UI.Input.ManipulationVelocities; - } - export interface IManipulationInertiaStartingEventArgs { - cumulative: Windows.UI.Input.ManipulationDelta; - delta: Windows.UI.Input.ManipulationDelta; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - velocities: Windows.UI.Input.ManipulationVelocities; - } - export interface IManipulationCompletedEventArgs { - cumulative: Windows.UI.Input.ManipulationDelta; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - velocities: Windows.UI.Input.ManipulationVelocities; - } - export interface ICrossSlidingEventArgs { - crossSlidingState: Windows.UI.Input.CrossSlidingState; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - } - export interface IMouseWheelParameters { - charTranslation: Windows.Foundation.Point; - deltaRotationAngle: number; - deltaScale: number; - pageTranslation: Windows.Foundation.Point; - } - export interface IGestureRecognizer { - autoProcessInertia: boolean; - crossSlideExact: boolean; - crossSlideHorizontally: boolean; - crossSlideThresholds: Windows.UI.Input.CrossSlideThresholds; - gestureSettings: Windows.UI.Input.GestureSettings; - inertiaExpansion: number; - inertiaExpansionDeceleration: number; - inertiaRotationAngle: number; - inertiaRotationDeceleration: number; - inertiaTranslationDeceleration: number; - inertiaTranslationDisplacement: number; - isActive: boolean; - isInertial: boolean; - manipulationExact: boolean; - mouseWheelParameters: Windows.UI.Input.MouseWheelParameters; - pivotCenter: Windows.Foundation.Point; - pivotRadius: number; - showGestureFeedback: boolean; - canBeDoubleTap(value: Windows.UI.Input.PointerPoint): boolean; - processDownEvent(value: Windows.UI.Input.PointerPoint): void; - processMoveEvents(value: Windows.Foundation.Collections.IVector): void; - processUpEvent(value: Windows.UI.Input.PointerPoint): void; - processMouseWheelEvent(value: Windows.UI.Input.PointerPoint, isShiftKeyDown: boolean, isControlKeyDown: boolean): void; - processInertia(): void; - completeGesture(): void; - ontapped: any/* TODO */; - onrighttapped: any/* TODO */; - onholding: any/* TODO */; - ondragging: any/* TODO */; - onmanipulationstarted: any/* TODO */; - onmanipulationupdated: any/* TODO */; - onmanipulationinertiastarting: any/* TODO */; - onmanipulationcompleted: any/* TODO */; - oncrosssliding: any/* TODO */; - } - export class MouseWheelParameters implements Windows.UI.Input.IMouseWheelParameters { - charTranslation: Windows.Foundation.Point; - deltaRotationAngle: number; - deltaScale: number; - pageTranslation: Windows.Foundation.Point; - } - export class GestureRecognizer implements Windows.UI.Input.IGestureRecognizer { - autoProcessInertia: boolean; - crossSlideExact: boolean; - crossSlideHorizontally: boolean; - crossSlideThresholds: Windows.UI.Input.CrossSlideThresholds; - gestureSettings: Windows.UI.Input.GestureSettings; - inertiaExpansion: number; - inertiaExpansionDeceleration: number; - inertiaRotationAngle: number; - inertiaRotationDeceleration: number; - inertiaTranslationDeceleration: number; - inertiaTranslationDisplacement: number; - isActive: boolean; - isInertial: boolean; - manipulationExact: boolean; - mouseWheelParameters: Windows.UI.Input.MouseWheelParameters; - pivotCenter: Windows.Foundation.Point; - pivotRadius: number; - showGestureFeedback: boolean; - canBeDoubleTap(value: Windows.UI.Input.PointerPoint): boolean; - processDownEvent(value: Windows.UI.Input.PointerPoint): void; - processMoveEvents(value: Windows.Foundation.Collections.IVector): void; - processUpEvent(value: Windows.UI.Input.PointerPoint): void; - processMouseWheelEvent(value: Windows.UI.Input.PointerPoint, isShiftKeyDown: boolean, isControlKeyDown: boolean): void; - processInertia(): void; - completeGesture(): void; - ontapped: any/* TODO */; - onrighttapped: any/* TODO */; - onholding: any/* TODO */; - ondragging: any/* TODO */; - onmanipulationstarted: any/* TODO */; - onmanipulationupdated: any/* TODO */; - onmanipulationinertiastarting: any/* TODO */; - onmanipulationcompleted: any/* TODO */; - oncrosssliding: any/* TODO */; - } - export class TappedEventArgs implements Windows.UI.Input.ITappedEventArgs { - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - tapCount: number; - } - export class RightTappedEventArgs implements Windows.UI.Input.IRightTappedEventArgs { - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - } - export class HoldingEventArgs implements Windows.UI.Input.IHoldingEventArgs { - holdingState: Windows.UI.Input.HoldingState; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - } - export class DraggingEventArgs implements Windows.UI.Input.IDraggingEventArgs { - draggingState: Windows.UI.Input.DraggingState; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - } - export class ManipulationStartedEventArgs implements Windows.UI.Input.IManipulationStartedEventArgs { - cumulative: Windows.UI.Input.ManipulationDelta; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - } - export class ManipulationUpdatedEventArgs implements Windows.UI.Input.IManipulationUpdatedEventArgs { - cumulative: Windows.UI.Input.ManipulationDelta; - delta: Windows.UI.Input.ManipulationDelta; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - velocities: Windows.UI.Input.ManipulationVelocities; - } - export class ManipulationInertiaStartingEventArgs implements Windows.UI.Input.IManipulationInertiaStartingEventArgs { - cumulative: Windows.UI.Input.ManipulationDelta; - delta: Windows.UI.Input.ManipulationDelta; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - velocities: Windows.UI.Input.ManipulationVelocities; - } - export class ManipulationCompletedEventArgs implements Windows.UI.Input.IManipulationCompletedEventArgs { - cumulative: Windows.UI.Input.ManipulationDelta; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - velocities: Windows.UI.Input.ManipulationVelocities; - } - export class CrossSlidingEventArgs implements Windows.UI.Input.ICrossSlidingEventArgs { - crossSlidingState: Windows.UI.Input.CrossSlidingState; - pointerDeviceType: Windows.Devices.Input.PointerDeviceType; - position: Windows.Foundation.Point; - } - export interface IPointerPointStatics { - getCurrentPoint(pointerId: number): Windows.UI.Input.PointerPoint; - getIntermediatePoints(pointerId: number): Windows.Foundation.Collections.IVector; - getCurrentPoint(pointerId: number, transform: Windows.UI.Input.IPointerPointTransform): Windows.UI.Input.PointerPoint; - getIntermediatePoints(pointerId: number, transform: Windows.UI.Input.IPointerPointTransform): Windows.Foundation.Collections.IVector; - } - export class PointerPoint implements Windows.UI.Input.IPointerPoint { - frameId: number; - isInContact: boolean; - pointerDevice: Windows.Devices.Input.PointerDevice; - pointerId: number; - position: Windows.Foundation.Point; - properties: Windows.UI.Input.PointerPointProperties; - rawPosition: Windows.Foundation.Point; - timestamp: number; - static getCurrentPoint(pointerId: number): Windows.UI.Input.PointerPoint; - static getIntermediatePoints(pointerId: number): Windows.Foundation.Collections.IVector; - static getCurrentPoint(pointerId: number, transform: Windows.UI.Input.IPointerPointTransform): Windows.UI.Input.PointerPoint; - static getIntermediatePoints(pointerId: number, transform: Windows.UI.Input.IPointerPointTransform): Windows.Foundation.Collections.IVector; - } - export interface IPointerPointTransform { - inverse: Windows.UI.Input.IPointerPointTransform; - tryTransform(inPoint: Windows.Foundation.Point): { outPoint: Windows.Foundation.Point; returnValue: boolean; }; - transformBounds(rect: Windows.Foundation.Rect): Windows.Foundation.Rect; - } - export interface IPointerPoint { - frameId: number; - isInContact: boolean; - pointerDevice: Windows.Devices.Input.PointerDevice; - pointerId: number; - position: Windows.Foundation.Point; - properties: Windows.UI.Input.PointerPointProperties; - rawPosition: Windows.Foundation.Point; - timestamp: number; - } - export class PointerPointProperties implements Windows.UI.Input.IPointerPointProperties { - contactRect: Windows.Foundation.Rect; - contactRectRaw: Windows.Foundation.Rect; - isBarrelButtonPressed: boolean; - isCanceled: boolean; - isEraser: boolean; - isHorizontalMouseWheel: boolean; - isInRange: boolean; - isInverted: boolean; - isLeftButtonPressed: boolean; - isMiddleButtonPressed: boolean; - isPrimary: boolean; - isRightButtonPressed: boolean; - isXButton1Pressed: boolean; - isXButton2Pressed: boolean; - mouseWheelDelta: number; - orientation: number; - pointerUpdateKind: Windows.UI.Input.PointerUpdateKind; - pressure: number; - touchConfidence: boolean; - twist: number; - xTilt: number; - yTilt: number; - hasUsage(usagePage: number, usageId: number): boolean; - getUsageValue(usagePage: number, usageId: number): number; - } - export enum PointerUpdateKind { - other, - leftButtonPressed, - leftButtonReleased, - rightButtonPressed, - rightButtonReleased, - middleButtonPressed, - middleButtonReleased, - xButton1Pressed, - xButton1Released, - xButton2Pressed, - xButton2Released, - } - export interface IPointerPointProperties { - contactRect: Windows.Foundation.Rect; - contactRectRaw: Windows.Foundation.Rect; - isBarrelButtonPressed: boolean; - isCanceled: boolean; - isEraser: boolean; - isHorizontalMouseWheel: boolean; - isInRange: boolean; - isInverted: boolean; - isLeftButtonPressed: boolean; - isMiddleButtonPressed: boolean; - isPrimary: boolean; - isRightButtonPressed: boolean; - isXButton1Pressed: boolean; - isXButton2Pressed: boolean; - mouseWheelDelta: number; - orientation: number; - pointerUpdateKind: Windows.UI.Input.PointerUpdateKind; - pressure: number; - touchConfidence: boolean; - twist: number; - xTilt: number; - yTilt: number; - hasUsage(usagePage: number, usageId: number): boolean; - getUsageValue(usagePage: number, usageId: number): number; - } - export interface IPointerVisualizationSettings { - isBarrelButtonFeedbackEnabled: boolean; - isContactFeedbackEnabled: boolean; - } - export interface IPointerVisualizationSettingsStatics { - getForCurrentView(): Windows.UI.Input.PointerVisualizationSettings; - } - export class PointerVisualizationSettings implements Windows.UI.Input.IPointerVisualizationSettings { - isBarrelButtonFeedbackEnabled: boolean; - isContactFeedbackEnabled: boolean; - static getForCurrentView(): Windows.UI.Input.PointerVisualizationSettings; - } - } - } -} -declare module Windows { - export module UI { - export module Popups { - export enum MessageDialogOptions { - none, - acceptUserInputAfterDelay, - } - export interface IMessageDialog { - cancelCommandIndex: number; - commands: Windows.Foundation.Collections.IVector; - content: string; - defaultCommandIndex: number; - options: Windows.UI.Popups.MessageDialogOptions; - title: string; - showAsync(): Windows.Foundation.IAsyncOperation; - } - export interface IMessageDialogFactory { - create(content: string): Windows.UI.Popups.MessageDialog; - createWithTitle(content: string, title: string): Windows.UI.Popups.MessageDialog; - } - export class MessageDialog implements Windows.UI.Popups.IMessageDialog { - constructor(content: string); - constructor(content: string, title: string); - cancelCommandIndex: number; - commands: Windows.Foundation.Collections.IVector; - content: string; - defaultCommandIndex: number; - options: Windows.UI.Popups.MessageDialogOptions; - title: string; - showAsync(): Windows.Foundation.IAsyncOperation; - } - export enum Placement { - default, - above, - below, - left, - right, - } - export interface UICommandInvokedHandler { - (command: Windows.UI.Popups.IUICommand): void; - } - export interface IUICommand { - id: any; - invoked: Windows.UI.Popups.UICommandInvokedHandler; - label: string; - } - export interface IUICommandFactory { - create(label: string): Windows.UI.Popups.UICommand; - createWithHandler(label: string, action: Windows.UI.Popups.UICommandInvokedHandler): Windows.UI.Popups.UICommand; - createWithHandlerAndId(label: string, action: Windows.UI.Popups.UICommandInvokedHandler, commandId: any): Windows.UI.Popups.UICommand; - } - export class UICommand implements Windows.UI.Popups.IUICommand { - constructor(label: string); - constructor(label: string, action: Windows.UI.Popups.UICommandInvokedHandler); - constructor(label: string, action: Windows.UI.Popups.UICommandInvokedHandler, commandId: any); - constructor(); - id: any; - invoked: Windows.UI.Popups.UICommandInvokedHandler; - label: string; - } - export class UICommandSeparator implements Windows.UI.Popups.IUICommand { - id: any; - invoked: Windows.UI.Popups.UICommandInvokedHandler; - label: string; - } - export interface IPopupMenu { - commands: Windows.Foundation.Collections.IVector; - showAsync(invocationPoint: Windows.Foundation.Point): Windows.Foundation.IAsyncOperation; - showForSelectionAsync(selection: Windows.Foundation.Rect): Windows.Foundation.IAsyncOperation; - showForSelectionAsync(selection: Windows.Foundation.Rect, preferredPlacement: Windows.UI.Popups.Placement): Windows.Foundation.IAsyncOperation; - } - export class PopupMenu implements Windows.UI.Popups.IPopupMenu { - commands: Windows.Foundation.Collections.IVector; - showAsync(invocationPoint: Windows.Foundation.Point): Windows.Foundation.IAsyncOperation; - showForSelectionAsync(selection: Windows.Foundation.Rect): Windows.Foundation.IAsyncOperation; - showForSelectionAsync(selection: Windows.Foundation.Rect, preferredPlacement: Windows.UI.Popups.Placement): Windows.Foundation.IAsyncOperation; - } - } - } -} -declare module Windows { - export module UI { - export module StartScreen { - export enum TileOptions { - none, - showNameOnLogo, - showNameOnWideLogo, - copyOnDeployment, - } - export enum ForegroundText { - dark, - light, - } - export interface ISecondaryTile { - arguments: string; - backgroundColor: Windows.UI.Color; - displayName: string; - foregroundText: Windows.UI.StartScreen.ForegroundText; - lockScreenBadgeLogo: Windows.Foundation.Uri; - lockScreenDisplayBadgeAndTileText: boolean; - logo: Windows.Foundation.Uri; - shortName: string; - smallLogo: Windows.Foundation.Uri; - tileId: string; - tileOptions: Windows.UI.StartScreen.TileOptions; - wideLogo: Windows.Foundation.Uri; - requestCreateAsync(): Windows.Foundation.IAsyncOperation; - requestCreateAsync(invocationPoint: Windows.Foundation.Point): Windows.Foundation.IAsyncOperation; - requestCreateForSelectionAsync(selection: Windows.Foundation.Rect): Windows.Foundation.IAsyncOperation; - requestCreateForSelectionAsync(selection: Windows.Foundation.Rect, preferredPlacement: Windows.UI.Popups.Placement): Windows.Foundation.IAsyncOperation; - requestDeleteAsync(): Windows.Foundation.IAsyncOperation; - requestDeleteAsync(invocationPoint: Windows.Foundation.Point): Windows.Foundation.IAsyncOperation; - requestDeleteForSelectionAsync(selection: Windows.Foundation.Rect): Windows.Foundation.IAsyncOperation; - requestDeleteForSelectionAsync(selection: Windows.Foundation.Rect, preferredPlacement: Windows.UI.Popups.Placement): Windows.Foundation.IAsyncOperation; - updateAsync(): Windows.Foundation.IAsyncOperation; - } - export interface ISecondaryTileFactory { - createTile(tileId: string, shortName: string, displayName: string, arguments: string, tileOptions: Windows.UI.StartScreen.TileOptions, logoReference: Windows.Foundation.Uri): Windows.UI.StartScreen.SecondaryTile; - createWideTile(tileId: string, shortName: string, displayName: string, arguments: string, tileOptions: Windows.UI.StartScreen.TileOptions, logoReference: Windows.Foundation.Uri, wideLogoReference: Windows.Foundation.Uri): Windows.UI.StartScreen.SecondaryTile; - createWithId(tileId: string): Windows.UI.StartScreen.SecondaryTile; - } - export class SecondaryTile implements Windows.UI.StartScreen.ISecondaryTile { - constructor(tileId: string, shortName: string, displayName: string, arguments: string, tileOptions: Windows.UI.StartScreen.TileOptions, logoReference: Windows.Foundation.Uri); - constructor(tileId: string, shortName: string, displayName: string, arguments: string, tileOptions: Windows.UI.StartScreen.TileOptions, logoReference: Windows.Foundation.Uri, wideLogoReference: Windows.Foundation.Uri); - constructor(tileId: string); - constructor(); - arguments: string; - backgroundColor: Windows.UI.Color; - displayName: string; - foregroundText: Windows.UI.StartScreen.ForegroundText; - lockScreenBadgeLogo: Windows.Foundation.Uri; - lockScreenDisplayBadgeAndTileText: boolean; - logo: Windows.Foundation.Uri; - shortName: string; - smallLogo: Windows.Foundation.Uri; - tileId: string; - tileOptions: Windows.UI.StartScreen.TileOptions; - wideLogo: Windows.Foundation.Uri; - requestCreateAsync(): Windows.Foundation.IAsyncOperation; - requestCreateAsync(invocationPoint: Windows.Foundation.Point): Windows.Foundation.IAsyncOperation; - requestCreateForSelectionAsync(selection: Windows.Foundation.Rect): Windows.Foundation.IAsyncOperation; - requestCreateForSelectionAsync(selection: Windows.Foundation.Rect, preferredPlacement: Windows.UI.Popups.Placement): Windows.Foundation.IAsyncOperation; - requestDeleteAsync(): Windows.Foundation.IAsyncOperation; - requestDeleteAsync(invocationPoint: Windows.Foundation.Point): Windows.Foundation.IAsyncOperation; - requestDeleteForSelectionAsync(selection: Windows.Foundation.Rect): Windows.Foundation.IAsyncOperation; - requestDeleteForSelectionAsync(selection: Windows.Foundation.Rect, preferredPlacement: Windows.UI.Popups.Placement): Windows.Foundation.IAsyncOperation; - updateAsync(): Windows.Foundation.IAsyncOperation; - static exists(tileId: string): boolean; - static findAllAsync(): Windows.Foundation.IAsyncOperation>; - static findAllAsync(applicationId: string): Windows.Foundation.IAsyncOperation>; - static findAllForPackageAsync(): Windows.Foundation.IAsyncOperation>; - } - export interface ISecondaryTileStatics { - exists(tileId: string): boolean; - findAllAsync(): Windows.Foundation.IAsyncOperation>; - findAllAsync(applicationId: string): Windows.Foundation.IAsyncOperation>; - findAllForPackageAsync(): Windows.Foundation.IAsyncOperation>; - } - } - } -} -declare module Windows { - export module UI { - export module Text { - export enum CaretType { - normal, - null_, - } - export enum FindOptions { - none, - word, - case_, - } - export enum FormatEffect { - off, - on, - toggle, - undefined, - } - export enum HorizontalCharacterAlignment { - left, - right, - center, - } - export enum LetterCase { - lower, - upper, - } - export enum LineSpacingRule { - undefined, - single, - oneAndHalf, - double, - atLeast, - exactly, - multiple, - percent, - } - export enum LinkType { - undefined, - notALink, - clientLink, - friendlyLinkName, - friendlyLinkAddress, - autoLink, - autoLinkEmail, - autoLinkPhone, - autoLinkPath, - } - export enum MarkerAlignment { - undefined, - left, - center, - right, - } - export enum MarkerStyle { - undefined, - parenthesis, - parentheses, - period, - plain, - minus, - noNumber, - } - export enum MarkerType { - undefined, - none, - bullet, - arabic, - lowercaseEnglishLetter, - uppercaseEnglishLetter, - lowercaseRoman, - uppercaseRoman, - unicodeSequence, - circledNumber, - blackCircleWingding, - whiteCircleWingding, - arabicWide, - simplifiedChinese, - traditionalChinese, - japanSimplifiedChinese, - japanKorea, - arabicDictionary, - arabicAbjad, - hebrew, - thaiAlphabetic, - thaiNumeric, - devanagariVowel, - devanagariConsonant, - devanagariNumeric, - } - export enum ParagraphAlignment { - undefined, - left, - center, - right, - justify, - } - export enum ParagraphStyle { - undefined, - none, - normal, - heading1, - heading2, - heading3, - heading4, - heading5, - heading6, - heading7, - heading8, - heading9, - } - export enum PointOptions { - none, - includeInset, - start, - clientCoordinates, - allowOffClient, - transform, - noHorizontalScroll, - noVerticalScroll, - } - export enum RangeGravity { - uIBehavior, - backward, - forward, - inward, - outward, - } - export enum SelectionOptions { - startActive, - atEndOfLine, - overtype, - active, - replace, - } - export enum SelectionType { - none, - insertionPoint, - normal, - inlineShape, - shape, - } - export enum TabAlignment { - left, - center, - right, - decimal, - bar, - } - export enum TabLeader { - spaces, - dots, - dashes, - lines, - thickLines, - equals, - } - export enum TextGetOptions { - none, - adjustCrlf, - useCrlf, - useObjectText, - allowFinalEop, - noHidden, - includeNumbering, - formatRtf, - } - export enum TextSetOptions { - none, - unicodeBidi, - unlink, - unhide, - checkTextLimit, - formatRtf, - applyRtfDocumentDefaults, - } - export enum TextRangeUnit { - character, - word, - sentence, - paragraph, - line, - story, - screen, - section, - window, - characterFormat, - paragraphFormat, - object, - hardParagraph, - cluster, - bold, - italic, - underline, - strikethrough, - protectedText, - link, - smallCaps, - allCaps, - hidden, - outline, - shadow, - imprint, - disabled, - revised, - subscript, - superscript, - fontBound, - linkProtected, - } - export enum TextScript { - undefined, - ansi, - eastEurope, - cyrillic, - greek, - turkish, - hebrew, - arabic, - baltic, - vietnamese, - default, - symbol, - thai, - shiftJis, - gB2312, - hangul, - big5, - pC437, - oem, - mac, - armenian, - syriac, - thaana, - devanagari, - bengali, - gurmukhi, - gujarati, - oriya, - tamil, - telugu, - kannada, - malayalam, - sinhala, - lao, - tibetan, - myanmar, - georgian, - jamo, - ethiopic, - cherokee, - aboriginal, - ogham, - runic, - khmer, - mongolian, - braille, - yi, - limbu, - taiLe, - newTaiLue, - sylotiNagri, - kharoshthi, - kayahli, - unicodeSymbol, - emoji, - glagolitic, - lisu, - vai, - nKo, - osmanya, - phagsPa, - gothic, - deseret, - tifinagh, - } - export enum UnderlineType { - undefined, - none, - single, - words, - double, - dotted, - dash, - dashDot, - dashDotDot, - wave, - thick, - thin, - doubleWave, - heavyWave, - longDash, - thickDash, - thickDashDot, - thickDashDotDot, - thickDotted, - thickLongDash, - } - export enum VerticalCharacterAlignment { - top, - baseline, - bottom, - } - export class TextConstants { - static autoColor: Windows.UI.Color; - static maxUnitCount: number; - static minUnitCount: number; - static undefinedColor: Windows.UI.Color; - static undefinedFloatValue: number; - static undefinedFontStretch: Windows.UI.Text.FontStretch; - static undefinedFontStyle: Windows.UI.Text.FontStyle; - static undefinedInt32Value: number; - } - export interface ITextConstantsStatics { - autoColor: Windows.UI.Color; - maxUnitCount: number; - minUnitCount: number; - undefinedColor: Windows.UI.Color; - undefinedFloatValue: number; - undefinedFontStretch: Windows.UI.Text.FontStretch; - undefinedFontStyle: Windows.UI.Text.FontStyle; - undefinedInt32Value: number; - } - export interface ITextDocument { - caretType: Windows.UI.Text.CaretType; - defaultTabStop: number; - selection: Windows.UI.Text.ITextSelection; - undoLimit: number; - canCopy(): boolean; - canPaste(): boolean; - canRedo(): boolean; - canUndo(): boolean; - applyDisplayUpdates(): number; - batchDisplayUpdates(): number; - beginUndoGroup(): void; - endUndoGroup(): void; - getDefaultCharacterFormat(): Windows.UI.Text.ITextCharacterFormat; - getDefaultParagraphFormat(): Windows.UI.Text.ITextParagraphFormat; - getRange(startPosition: number, endPosition: number): Windows.UI.Text.ITextRange; - getRangeFromPoint(point: Windows.Foundation.Point, options: Windows.UI.Text.PointOptions): Windows.UI.Text.ITextRange; - getText(options: Windows.UI.Text.TextGetOptions): string; - loadFromStream(options: Windows.UI.Text.TextSetOptions, value: Windows.Storage.Streams.IRandomAccessStream): void; - redo(): void; - saveToStream(options: Windows.UI.Text.TextGetOptions, value: Windows.Storage.Streams.IRandomAccessStream): void; - setDefaultCharacterFormat(value: Windows.UI.Text.ITextCharacterFormat): void; - setDefaultParagraphFormat(value: Windows.UI.Text.ITextParagraphFormat): void; - setText(options: Windows.UI.Text.TextSetOptions, value: string): void; - undo(): void; - } - export interface ITextRange { - character: string; - characterFormat: Windows.UI.Text.ITextCharacterFormat; - endPosition: number; - formattedText: Windows.UI.Text.ITextRange; - gravity: Windows.UI.Text.RangeGravity; - length: number; - link: string; - paragraphFormat: Windows.UI.Text.ITextParagraphFormat; - startPosition: number; - storyLength: number; - text: string; - canPaste(format: number): boolean; - changeCase(value: Windows.UI.Text.LetterCase): void; - collapse(value: boolean): void; - copy(): void; - cut(): void; - delete_(unit: Windows.UI.Text.TextRangeUnit, count: number): number; - endOf(unit: Windows.UI.Text.TextRangeUnit, extend: boolean): number; - expand(unit: Windows.UI.Text.TextRangeUnit): number; - findText(value: string, scanLength: number, options: Windows.UI.Text.FindOptions): number; - getCharacterUtf32(offset: number): number; - getClone(): Windows.UI.Text.ITextRange; - getIndex(unit: Windows.UI.Text.TextRangeUnit): number; - getPoint(horizontalAlign: Windows.UI.Text.HorizontalCharacterAlignment, verticalAlign: Windows.UI.Text.VerticalCharacterAlignment, options: Windows.UI.Text.PointOptions): Windows.Foundation.Point; - getRect(options: Windows.UI.Text.PointOptions): { rect: Windows.Foundation.Rect; hit: number; }; - getText(options: Windows.UI.Text.TextGetOptions): string; - getTextViaStream(options: Windows.UI.Text.TextGetOptions, value: Windows.Storage.Streams.IRandomAccessStream): void; - inRange(range: Windows.UI.Text.ITextRange): boolean; - insertImage(width: number, height: number, ascent: number, verticalAlign: Windows.UI.Text.VerticalCharacterAlignment, alternateText: string, value: Windows.Storage.Streams.IRandomAccessStream): void; - inStory(range: Windows.UI.Text.ITextRange): boolean; - isEqual(range: Windows.UI.Text.ITextRange): boolean; - move(unit: Windows.UI.Text.TextRangeUnit, count: number): number; - moveEnd(unit: Windows.UI.Text.TextRangeUnit, count: number): number; - moveStart(unit: Windows.UI.Text.TextRangeUnit, count: number): number; - paste(format: number): void; - scrollIntoView(value: Windows.UI.Text.PointOptions): void; - matchSelection(): void; - setIndex(unit: Windows.UI.Text.TextRangeUnit, index: number, extend: boolean): void; - setPoint(point: Windows.Foundation.Point, options: Windows.UI.Text.PointOptions, extend: boolean): void; - setRange(startPosition: number, endPosition: number): void; - setText(options: Windows.UI.Text.TextSetOptions, value: string): void; - setTextViaStream(options: Windows.UI.Text.TextSetOptions, value: Windows.Storage.Streams.IRandomAccessStream): void; - startOf(unit: Windows.UI.Text.TextRangeUnit, extend: boolean): number; - } - export interface ITextSelection extends Windows.UI.Text.ITextRange { - options: Windows.UI.Text.SelectionOptions; - type: Windows.UI.Text.SelectionType; - endKey(unit: Windows.UI.Text.TextRangeUnit, extend: boolean): number; - homeKey(unit: Windows.UI.Text.TextRangeUnit, extend: boolean): number; - moveDown(unit: Windows.UI.Text.TextRangeUnit, count: number, extend: boolean): number; - moveLeft(unit: Windows.UI.Text.TextRangeUnit, count: number, extend: boolean): number; - moveRight(unit: Windows.UI.Text.TextRangeUnit, count: number, extend: boolean): number; - moveUp(unit: Windows.UI.Text.TextRangeUnit, count: number, extend: boolean): number; - typeText(value: string): void; - } - export interface ITextCharacterFormat { - allCaps: Windows.UI.Text.FormatEffect; - backgroundColor: Windows.UI.Color; - bold: Windows.UI.Text.FormatEffect; - fontStretch: Windows.UI.Text.FontStretch; - fontStyle: Windows.UI.Text.FontStyle; - foregroundColor: Windows.UI.Color; - hidden: Windows.UI.Text.FormatEffect; - italic: Windows.UI.Text.FormatEffect; - kerning: number; - languageTag: string; - linkType: Windows.UI.Text.LinkType; - name: string; - outline: Windows.UI.Text.FormatEffect; - position: number; - protectedText: Windows.UI.Text.FormatEffect; - size: number; - smallCaps: Windows.UI.Text.FormatEffect; - spacing: number; - strikethrough: Windows.UI.Text.FormatEffect; - subscript: Windows.UI.Text.FormatEffect; - superscript: Windows.UI.Text.FormatEffect; - textScript: Windows.UI.Text.TextScript; - underline: Windows.UI.Text.UnderlineType; - weight: number; - setClone(value: Windows.UI.Text.ITextCharacterFormat): void; - getClone(): Windows.UI.Text.ITextCharacterFormat; - isEqual(format: Windows.UI.Text.ITextCharacterFormat): boolean; - } - export interface ITextParagraphFormat { - alignment: Windows.UI.Text.ParagraphAlignment; - firstLineIndent: number; - keepTogether: Windows.UI.Text.FormatEffect; - keepWithNext: Windows.UI.Text.FormatEffect; - leftIndent: number; - lineSpacing: number; - lineSpacingRule: Windows.UI.Text.LineSpacingRule; - listAlignment: Windows.UI.Text.MarkerAlignment; - listLevelIndex: number; - listStart: number; - listStyle: Windows.UI.Text.MarkerStyle; - listTab: number; - listType: Windows.UI.Text.MarkerType; - noLineNumber: Windows.UI.Text.FormatEffect; - pageBreakBefore: Windows.UI.Text.FormatEffect; - rightIndent: number; - rightToLeft: Windows.UI.Text.FormatEffect; - spaceAfter: number; - spaceBefore: number; - style: Windows.UI.Text.ParagraphStyle; - tabCount: number; - widowControl: Windows.UI.Text.FormatEffect; - addTab(position: number, align: Windows.UI.Text.TabAlignment, leader: Windows.UI.Text.TabLeader): void; - clearAllTabs(): void; - deleteTab(position: number): void; - getClone(): Windows.UI.Text.ITextParagraphFormat; - getTab(index: number): { position: number; align: Windows.UI.Text.TabAlignment; leader: Windows.UI.Text.TabLeader; }; - isEqual(format: Windows.UI.Text.ITextParagraphFormat): boolean; - setClone(format: Windows.UI.Text.ITextParagraphFormat): void; - setIndents(start: number, left: number, right: number): void; - setLineSpacing(rule: Windows.UI.Text.LineSpacingRule, spacing: number): void; - } - export enum FontStyle { - normal, - oblique, - italic, - } - export enum FontStretch { - undefined, - ultraCondensed, - extraCondensed, - condensed, - semiCondensed, - normal, - semiExpanded, - expanded, - extraExpanded, - ultraExpanded, - } - export interface FontWeight { - weight: number; - } - export interface IFontWeights { - } - export interface IFontWeightsStatics { - black: Windows.UI.Text.FontWeight; - bold: Windows.UI.Text.FontWeight; - extraBlack: Windows.UI.Text.FontWeight; - extraBold: Windows.UI.Text.FontWeight; - extraLight: Windows.UI.Text.FontWeight; - light: Windows.UI.Text.FontWeight; - medium: Windows.UI.Text.FontWeight; - normal: Windows.UI.Text.FontWeight; - semiBold: Windows.UI.Text.FontWeight; - semiLight: Windows.UI.Text.FontWeight; - thin: Windows.UI.Text.FontWeight; - } - export class FontWeights implements Windows.UI.Text.IFontWeights { - static black: Windows.UI.Text.FontWeight; - static bold: Windows.UI.Text.FontWeight; - static extraBlack: Windows.UI.Text.FontWeight; - static extraBold: Windows.UI.Text.FontWeight; - static extraLight: Windows.UI.Text.FontWeight; - static light: Windows.UI.Text.FontWeight; - static medium: Windows.UI.Text.FontWeight; - static normal: Windows.UI.Text.FontWeight; - static semiBold: Windows.UI.Text.FontWeight; - static semiLight: Windows.UI.Text.FontWeight; - static thin: Windows.UI.Text.FontWeight; - } - } - } -} -declare module Windows { - export module UI { - export module Core { - export module AnimationMetrics { - export enum PropertyAnimationType { - scale, - translation, - opacity, - } - export interface IPropertyAnimation { - control1: Windows.Foundation.Point; - control2: Windows.Foundation.Point; - delay: number; - duration: number; - type: Windows.UI.Core.AnimationMetrics.PropertyAnimationType; - } - export interface IScaleAnimation extends Windows.UI.Core.AnimationMetrics.IPropertyAnimation { - finalScaleX: number; - finalScaleY: number; - initialScaleX: number; - initialScaleY: number; - normalizedOrigin: Windows.Foundation.Point; - } - export interface IOpacityAnimation extends Windows.UI.Core.AnimationMetrics.IPropertyAnimation { - finalOpacity: number; - initialOpacity: number; - } - export enum AnimationEffect { - expand, - collapse, - reposition, - fadeIn, - fadeOut, - addToList, - deleteFromList, - addToGrid, - deleteFromGrid, - addToSearchGrid, - deleteFromSearchGrid, - addToSearchList, - deleteFromSearchList, - showEdgeUI, - showPanel, - hideEdgeUI, - hidePanel, - showPopup, - hidePopup, - pointerDown, - pointerUp, - dragSourceStart, - dragSourceEnd, - transitionContent, - reveal, - hide, - dragBetweenEnter, - dragBetweenLeave, - swipeSelect, - swipeDeselect, - swipeReveal, - enterPage, - transitionPage, - crossFade, - peek, - updateBadge, - } - export enum AnimationEffectTarget { - primary, - added, - affected, - background, - content, - deleted, - deselected, - dragSource, - hidden, - incoming, - outgoing, - outline, - remaining, - revealed, - rowIn, - rowOut, - selected, - selection, - shown, - tapped, - } - export interface IAnimationDescription { - animations: Windows.Foundation.Collections.IVectorView; - delayLimit: number; - staggerDelay: number; - staggerDelayFactor: number; - zOrder: number; - } - export interface IAnimationDescriptionFactory { - createInstance(effect: Windows.UI.Core.AnimationMetrics.AnimationEffect, target: Windows.UI.Core.AnimationMetrics.AnimationEffectTarget): Windows.UI.Core.AnimationMetrics.AnimationDescription; - } - export class AnimationDescription implements Windows.UI.Core.AnimationMetrics.IAnimationDescription { - constructor(effect: Windows.UI.Core.AnimationMetrics.AnimationEffect, target: Windows.UI.Core.AnimationMetrics.AnimationEffectTarget); - animations: Windows.Foundation.Collections.IVectorView; - delayLimit: number; - staggerDelay: number; - staggerDelayFactor: number; - zOrder: number; - } - export class PropertyAnimation implements Windows.UI.Core.AnimationMetrics.IPropertyAnimation { - control1: Windows.Foundation.Point; - control2: Windows.Foundation.Point; - delay: number; - duration: number; - type: Windows.UI.Core.AnimationMetrics.PropertyAnimationType; - } - export class ScaleAnimation implements Windows.UI.Core.AnimationMetrics.IScaleAnimation, Windows.UI.Core.AnimationMetrics.IPropertyAnimation { - finalScaleX: number; - finalScaleY: number; - initialScaleX: number; - initialScaleY: number; - normalizedOrigin: Windows.Foundation.Point; - control1: Windows.Foundation.Point; - control2: Windows.Foundation.Point; - delay: number; - duration: number; - type: Windows.UI.Core.AnimationMetrics.PropertyAnimationType; - } - export class TranslationAnimation implements Windows.UI.Core.AnimationMetrics.IPropertyAnimation { - control1: Windows.Foundation.Point; - control2: Windows.Foundation.Point; - delay: number; - duration: number; - type: Windows.UI.Core.AnimationMetrics.PropertyAnimationType; - } - export class OpacityAnimation implements Windows.UI.Core.AnimationMetrics.IOpacityAnimation, Windows.UI.Core.AnimationMetrics.IPropertyAnimation { - finalOpacity: number; - initialOpacity: number; - control1: Windows.Foundation.Point; - control2: Windows.Foundation.Point; - delay: number; - duration: number; - type: Windows.UI.Core.AnimationMetrics.PropertyAnimationType; - } - } - } - } -} -declare module Windows { - export module UI { - export module Core { - export enum CoreWindowActivationState { - codeActivated, - deactivated, - pointerActivated, - } - export enum CoreCursorType { - arrow, - cross, - custom, - hand, - help, - iBeam, - sizeAll, - sizeNortheastSouthwest, - sizeNorthSouth, - sizeNorthwestSoutheast, - sizeWestEast, - universalNo, - upArrow, - wait, - } - export enum CoreDispatcherPriority { - low, - normal, - high, - } - export enum CoreProcessEventsOption { - processOneAndAllPending, - processOneIfPresent, - processUntilQuit, - processAllIfPresent, - } - export enum CoreWindowFlowDirection { - leftToRight, - rightToLeft, - } - export enum CoreVirtualKeyStates { - none, - down, - locked, - } - export enum CoreAcceleratorKeyEventType { - character, - deadCharacter, - keyDown, - keyUp, - systemCharacter, - systemDeadCharacter, - systemKeyDown, - systemKeyUp, - unicodeCharacter, - } - export enum CoreProximityEvaluationScore { - closest, - farthest, - } - export interface CorePhysicalKeyStatus { - repeatCount: number; - scanCode: number; - isExtendedKey: boolean; - isMenuKeyDown: boolean; - wasKeyDown: boolean; - isKeyReleased: boolean; - } - export interface CoreProximityEvaluation { - score: number; - adjustedPoint: Windows.Foundation.Point; - } - export interface ICoreWindowEventArgs { - handled: boolean; - } - export interface IAutomationProviderRequestedEventArgs extends Windows.UI.Core.ICoreWindowEventArgs { - automationProvider: any; - } - export interface ICharacterReceivedEventArgs extends Windows.UI.Core.ICoreWindowEventArgs { - keyCode: number; - keyStatus: Windows.UI.Core.CorePhysicalKeyStatus; - } - export interface IInputEnabledEventArgs extends Windows.UI.Core.ICoreWindowEventArgs { - inputEnabled: boolean; - } - export interface IKeyEventArgs extends Windows.UI.Core.ICoreWindowEventArgs { - keyStatus: Windows.UI.Core.CorePhysicalKeyStatus; - virtualKey: Windows.System.VirtualKey; - } - export interface IPointerEventArgs extends Windows.UI.Core.ICoreWindowEventArgs { - currentPoint: Windows.UI.Input.PointerPoint; - keyModifiers: Windows.System.VirtualKeyModifiers; - getIntermediatePoints(): Windows.Foundation.Collections.IVector; - } - export interface ITouchHitTestingEventArgs extends Windows.UI.Core.ICoreWindowEventArgs { - boundingBox: Windows.Foundation.Rect; - point: Windows.Foundation.Point; - proximityEvaluation: Windows.UI.Core.CoreProximityEvaluation; - evaluateProximity(controlBoundingBox: Windows.Foundation.Rect): Windows.UI.Core.CoreProximityEvaluation; - evaluateProximity(controlVertices: Windows.Foundation.Point[]): Windows.UI.Core.CoreProximityEvaluation; - } - export interface IWindowActivatedEventArgs extends Windows.UI.Core.ICoreWindowEventArgs { - windowActivationState: Windows.UI.Core.CoreWindowActivationState; - } - export interface IWindowSizeChangedEventArgs extends Windows.UI.Core.ICoreWindowEventArgs { - size: Windows.Foundation.Size; - } - export interface IVisibilityChangedEventArgs extends Windows.UI.Core.ICoreWindowEventArgs { - visible: boolean; - } - export interface ICoreWindow { - automationHostProvider: any; - bounds: Windows.Foundation.Rect; - customProperties: Windows.Foundation.Collections.IPropertySet; - dispatcher: Windows.UI.Core.CoreDispatcher; - flowDirection: Windows.UI.Core.CoreWindowFlowDirection; - isInputEnabled: boolean; - pointerCursor: Windows.UI.Core.CoreCursor; - pointerPosition: Windows.Foundation.Point; - visible: boolean; - activate(): void; - close(): void; - getAsyncKeyState(virtualKey: Windows.System.VirtualKey): Windows.UI.Core.CoreVirtualKeyStates; - getKeyState(virtualKey: Windows.System.VirtualKey): Windows.UI.Core.CoreVirtualKeyStates; - releasePointerCapture(): void; - setPointerCapture(): void; - onactivated: any/* TODO */; - onautomationproviderrequested: any/* TODO */; - oncharacterreceived: any/* TODO */; - onclosed: any/* TODO */; - oninputenabled: any/* TODO */; - onkeydown: any/* TODO */; - onkeyup: any/* TODO */; - onpointercapturelost: any/* TODO */; - onpointerentered: any/* TODO */; - onpointerexited: any/* TODO */; - onpointermoved: any/* TODO */; - onpointerpressed: any/* TODO */; - onpointerreleased: any/* TODO */; - ontouchhittesting: any/* TODO */; - onpointerwheelchanged: any/* TODO */; - onsizechanged: any/* TODO */; - onvisibilitychanged: any/* TODO */; - } - export class CoreDispatcher implements Windows.UI.Core.ICoreDispatcher, Windows.UI.Core.ICoreAcceleratorKeys { - hasThreadAccess: boolean; - processEvents(options: Windows.UI.Core.CoreProcessEventsOption): void; - runAsync(priority: Windows.UI.Core.CoreDispatcherPriority, agileCallback: Windows.UI.Core.DispatchedHandler): Windows.Foundation.IAsyncAction; - runIdleAsync(agileCallback: Windows.UI.Core.IdleDispatchedHandler): Windows.Foundation.IAsyncAction; - onacceleratorkeyactivated: any/* TODO */; - } - export class CoreCursor implements Windows.UI.Core.ICoreCursor { - constructor(type: Windows.UI.Core.CoreCursorType, id: number); - id: number; - type: Windows.UI.Core.CoreCursorType; - } - export class CoreWindow implements Windows.UI.Core.ICoreWindow { - automationHostProvider: any; - bounds: Windows.Foundation.Rect; - customProperties: Windows.Foundation.Collections.IPropertySet; - dispatcher: Windows.UI.Core.CoreDispatcher; - flowDirection: Windows.UI.Core.CoreWindowFlowDirection; - isInputEnabled: boolean; - pointerCursor: Windows.UI.Core.CoreCursor; - pointerPosition: Windows.Foundation.Point; - visible: boolean; - activate(): void; - close(): void; - getAsyncKeyState(virtualKey: Windows.System.VirtualKey): Windows.UI.Core.CoreVirtualKeyStates; - getKeyState(virtualKey: Windows.System.VirtualKey): Windows.UI.Core.CoreVirtualKeyStates; - releasePointerCapture(): void; - setPointerCapture(): void; - onactivated: any/* TODO */; - onautomationproviderrequested: any/* TODO */; - oncharacterreceived: any/* TODO */; - onclosed: any/* TODO */; - oninputenabled: any/* TODO */; - onkeydown: any/* TODO */; - onkeyup: any/* TODO */; - onpointercapturelost: any/* TODO */; - onpointerentered: any/* TODO */; - onpointerexited: any/* TODO */; - onpointermoved: any/* TODO */; - onpointerpressed: any/* TODO */; - onpointerreleased: any/* TODO */; - ontouchhittesting: any/* TODO */; - onpointerwheelchanged: any/* TODO */; - onsizechanged: any/* TODO */; - onvisibilitychanged: any/* TODO */; - static getForCurrentThread(): Windows.UI.Core.CoreWindow; - } - export class WindowActivatedEventArgs implements Windows.UI.Core.IWindowActivatedEventArgs, Windows.UI.Core.ICoreWindowEventArgs { - windowActivationState: Windows.UI.Core.CoreWindowActivationState; - handled: boolean; - } - export class AutomationProviderRequestedEventArgs implements Windows.UI.Core.IAutomationProviderRequestedEventArgs, Windows.UI.Core.ICoreWindowEventArgs { - automationProvider: any; - handled: boolean; - } - export class CharacterReceivedEventArgs implements Windows.UI.Core.ICharacterReceivedEventArgs, Windows.UI.Core.ICoreWindowEventArgs { - keyCode: number; - keyStatus: Windows.UI.Core.CorePhysicalKeyStatus; - handled: boolean; - } - export class CoreWindowEventArgs implements Windows.UI.Core.ICoreWindowEventArgs { - handled: boolean; - } - export class InputEnabledEventArgs implements Windows.UI.Core.IInputEnabledEventArgs, Windows.UI.Core.ICoreWindowEventArgs { - inputEnabled: boolean; - handled: boolean; - } - export class KeyEventArgs implements Windows.UI.Core.IKeyEventArgs, Windows.UI.Core.ICoreWindowEventArgs { - keyStatus: Windows.UI.Core.CorePhysicalKeyStatus; - virtualKey: Windows.System.VirtualKey; - handled: boolean; - } - export class PointerEventArgs implements Windows.UI.Core.IPointerEventArgs, Windows.UI.Core.ICoreWindowEventArgs { - currentPoint: Windows.UI.Input.PointerPoint; - keyModifiers: Windows.System.VirtualKeyModifiers; - handled: boolean; - getIntermediatePoints(): Windows.Foundation.Collections.IVector; - } - export class TouchHitTestingEventArgs implements Windows.UI.Core.ITouchHitTestingEventArgs, Windows.UI.Core.ICoreWindowEventArgs { - boundingBox: Windows.Foundation.Rect; - point: Windows.Foundation.Point; - proximityEvaluation: Windows.UI.Core.CoreProximityEvaluation; - handled: boolean; - evaluateProximity(controlBoundingBox: Windows.Foundation.Rect): Windows.UI.Core.CoreProximityEvaluation; - evaluateProximity(controlVertices: Windows.Foundation.Point[]): Windows.UI.Core.CoreProximityEvaluation; - } - export class WindowSizeChangedEventArgs implements Windows.UI.Core.IWindowSizeChangedEventArgs, Windows.UI.Core.ICoreWindowEventArgs { - size: Windows.Foundation.Size; - handled: boolean; - } - export class VisibilityChangedEventArgs implements Windows.UI.Core.IVisibilityChangedEventArgs, Windows.UI.Core.ICoreWindowEventArgs { - visible: boolean; - handled: boolean; - } - export interface ICoreWindowStatic { - getForCurrentThread(): Windows.UI.Core.CoreWindow; - } - export interface DispatchedHandler { - (): void; - } - export interface IdleDispatchedHandler { - (e: Windows.UI.Core.IdleDispatchedHandlerArgs): void; - } - export class IdleDispatchedHandlerArgs implements Windows.UI.Core.IIdleDispatchedHandlerArgs { - isDispatcherIdle: boolean; - } - export interface IAcceleratorKeyEventArgs extends Windows.UI.Core.ICoreWindowEventArgs { - eventType: Windows.UI.Core.CoreAcceleratorKeyEventType; - keyStatus: Windows.UI.Core.CorePhysicalKeyStatus; - virtualKey: Windows.System.VirtualKey; - } - export interface ICoreAcceleratorKeys { - onacceleratorkeyactivated: any/* TODO */; - } - export class AcceleratorKeyEventArgs implements Windows.UI.Core.IAcceleratorKeyEventArgs, Windows.UI.Core.ICoreWindowEventArgs { - eventType: Windows.UI.Core.CoreAcceleratorKeyEventType; - keyStatus: Windows.UI.Core.CorePhysicalKeyStatus; - virtualKey: Windows.System.VirtualKey; - handled: boolean; - } - export interface ICoreDispatcher extends Windows.UI.Core.ICoreAcceleratorKeys { - hasThreadAccess: boolean; - processEvents(options: Windows.UI.Core.CoreProcessEventsOption): void; - runAsync(priority: Windows.UI.Core.CoreDispatcherPriority, agileCallback: Windows.UI.Core.DispatchedHandler): Windows.Foundation.IAsyncAction; - runIdleAsync(agileCallback: Windows.UI.Core.IdleDispatchedHandler): Windows.Foundation.IAsyncAction; - } - export interface IIdleDispatchedHandlerArgs { - isDispatcherIdle: boolean; - } - export class CoreAcceleratorKeys implements Windows.UI.Core.ICoreAcceleratorKeys { - onacceleratorkeyactivated: any/* TODO */; - } - export interface ICoreCursor { - id: number; - type: Windows.UI.Core.CoreCursorType; - } - export interface ICoreCursorFactory { - createCursor(type: Windows.UI.Core.CoreCursorType, id: number): Windows.UI.Core.CoreCursor; - } - export interface IInitializeWithCoreWindow { - initialize(window: Windows.UI.Core.CoreWindow): void; - } - export interface ICoreWindowResizeManager { - notifyLayoutCompleted(): void; - } - export interface ICoreWindowResizeManagerStatics { - getForCurrentView(): Windows.UI.Core.CoreWindowResizeManager; - } - export class CoreWindowResizeManager implements Windows.UI.Core.ICoreWindowResizeManager { - notifyLayoutCompleted(): void; - static getForCurrentView(): Windows.UI.Core.CoreWindowResizeManager; - } - export interface ICoreWindowPopupShowingEventArgs { - setDesiredSize(value: Windows.Foundation.Size): void; - } - export class CoreWindowPopupShowingEventArgs implements Windows.UI.Core.ICoreWindowPopupShowingEventArgs { - setDesiredSize(value: Windows.Foundation.Size): void; - } - export interface ICoreWindowDialog { - backButtonCommand: Windows.UI.Popups.UICommandInvokedHandler; - cancelCommandIndex: number; - commands: Windows.Foundation.Collections.IVector; - defaultCommandIndex: number; - isInteractionDelayed: number; - maxSize: Windows.Foundation.Size; - minSize: Windows.Foundation.Size; - title: string; - onshowing: any/* TODO */; - showAsync(): Windows.Foundation.IAsyncOperation; - } - export interface ICoreWindowDialogFactory { - createWithTitle(title: string): Windows.UI.Core.CoreWindowDialog; - } - export class CoreWindowDialog implements Windows.UI.Core.ICoreWindowDialog { - constructor(title: string); - constructor(); - backButtonCommand: Windows.UI.Popups.UICommandInvokedHandler; - cancelCommandIndex: number; - commands: Windows.Foundation.Collections.IVector; - defaultCommandIndex: number; - isInteractionDelayed: number; - maxSize: Windows.Foundation.Size; - minSize: Windows.Foundation.Size; - title: string; - onshowing: any/* TODO */; - showAsync(): Windows.Foundation.IAsyncOperation; - } - export interface ICoreWindowFlyout { - backButtonCommand: Windows.UI.Popups.UICommandInvokedHandler; - commands: Windows.Foundation.Collections.IVector; - defaultCommandIndex: number; - isInteractionDelayed: number; - maxSize: Windows.Foundation.Size; - minSize: Windows.Foundation.Size; - title: string; - onshowing: any/* TODO */; - showAsync(): Windows.Foundation.IAsyncOperation; - } - export interface ICoreWindowFlyoutFactory { - create(position: Windows.Foundation.Point): Windows.UI.Core.CoreWindowFlyout; - createWithTitle(position: Windows.Foundation.Point, title: string): Windows.UI.Core.CoreWindowFlyout; - } - export class CoreWindowFlyout implements Windows.UI.Core.ICoreWindowFlyout { - constructor(position: Windows.Foundation.Point); - constructor(position: Windows.Foundation.Point, title: string); - backButtonCommand: Windows.UI.Popups.UICommandInvokedHandler; - commands: Windows.Foundation.Collections.IVector; - defaultCommandIndex: number; - isInteractionDelayed: number; - maxSize: Windows.Foundation.Size; - minSize: Windows.Foundation.Size; - title: string; - onshowing: any/* TODO */; - showAsync(): Windows.Foundation.IAsyncOperation; - } - } - } -} -declare module Windows { - export module UI { - export module Input { - export module Inking { - export enum InkManipulationMode { - inking, - erasing, - selecting, - } - export enum InkRecognitionTarget { - all, - selected, - recent, - } - export enum PenTipShape { - circle, - rectangle, - } - export interface IInkDrawingAttributes { - color: Windows.UI.Color; - fitToCurve: boolean; - ignorePressure: boolean; - penTip: Windows.UI.Input.Inking.PenTipShape; - size: Windows.Foundation.Size; - } - export class InkDrawingAttributes implements Windows.UI.Input.Inking.IInkDrawingAttributes { - color: Windows.UI.Color; - fitToCurve: boolean; - ignorePressure: boolean; - penTip: Windows.UI.Input.Inking.PenTipShape; - size: Windows.Foundation.Size; - } - export interface IInkStrokeRenderingSegment { - bezierControlPoint1: Windows.Foundation.Point; - bezierControlPoint2: Windows.Foundation.Point; - position: Windows.Foundation.Point; - pressure: number; - tiltX: number; - tiltY: number; - twist: number; - } - export class InkStrokeRenderingSegment implements Windows.UI.Input.Inking.IInkStrokeRenderingSegment { - bezierControlPoint1: Windows.Foundation.Point; - bezierControlPoint2: Windows.Foundation.Point; - position: Windows.Foundation.Point; - pressure: number; - tiltX: number; - tiltY: number; - twist: number; - } - export interface IInkStroke { - boundingRect: Windows.Foundation.Rect; - drawingAttributes: Windows.UI.Input.Inking.InkDrawingAttributes; - recognized: boolean; - selected: boolean; - getRenderingSegments(): Windows.Foundation.Collections.IVectorView; - clone(): Windows.UI.Input.Inking.InkStroke; - } - export class InkStroke implements Windows.UI.Input.Inking.IInkStroke { - boundingRect: Windows.Foundation.Rect; - drawingAttributes: Windows.UI.Input.Inking.InkDrawingAttributes; - recognized: boolean; - selected: boolean; - getRenderingSegments(): Windows.Foundation.Collections.IVectorView; - clone(): Windows.UI.Input.Inking.InkStroke; - } - export interface IInkStrokeBuilder { - beginStroke(pointerPoint: Windows.UI.Input.PointerPoint): void; - appendToStroke(pointerPoint: Windows.UI.Input.PointerPoint): Windows.UI.Input.PointerPoint; - endStroke(pointerPoint: Windows.UI.Input.PointerPoint): Windows.UI.Input.Inking.InkStroke; - createStroke(points: Windows.Foundation.Collections.IIterable): Windows.UI.Input.Inking.InkStroke; - setDefaultDrawingAttributes(drawingAttributes: Windows.UI.Input.Inking.InkDrawingAttributes): void; - } - export class InkStrokeBuilder implements Windows.UI.Input.Inking.IInkStrokeBuilder { - beginStroke(pointerPoint: Windows.UI.Input.PointerPoint): void; - appendToStroke(pointerPoint: Windows.UI.Input.PointerPoint): Windows.UI.Input.PointerPoint; - endStroke(pointerPoint: Windows.UI.Input.PointerPoint): Windows.UI.Input.Inking.InkStroke; - createStroke(points: Windows.Foundation.Collections.IIterable): Windows.UI.Input.Inking.InkStroke; - setDefaultDrawingAttributes(drawingAttributes: Windows.UI.Input.Inking.InkDrawingAttributes): void; - } - export interface IInkRecognitionResult { - boundingRect: Windows.Foundation.Rect; - getTextCandidates(): Windows.Foundation.Collections.IVectorView; - getStrokes(): Windows.Foundation.Collections.IVectorView; - } - export class InkRecognitionResult implements Windows.UI.Input.Inking.IInkRecognitionResult { - boundingRect: Windows.Foundation.Rect; - getTextCandidates(): Windows.Foundation.Collections.IVectorView; - getStrokes(): Windows.Foundation.Collections.IVectorView; - } - export interface IInkStrokeContainer { - boundingRect: Windows.Foundation.Rect; - addStroke(stroke: Windows.UI.Input.Inking.InkStroke): void; - deleteSelected(): Windows.Foundation.Rect; - moveSelected(translation: Windows.Foundation.Point): Windows.Foundation.Rect; - selectWithPolyLine(polyline: Windows.Foundation.Collections.IIterable): Windows.Foundation.Rect; - selectWithLine(from: Windows.Foundation.Point, to: Windows.Foundation.Point): Windows.Foundation.Rect; - copySelectedToClipboard(): void; - pasteFromClipboard(position: Windows.Foundation.Point): Windows.Foundation.Rect; - canPasteFromClipboard(): boolean; - loadAsync(inputStream: Windows.Storage.Streams.IInputStream): Windows.Foundation.IAsyncActionWithProgress; - saveAsync(outputStream: Windows.Storage.Streams.IOutputStream): Windows.Foundation.IAsyncOperationWithProgress; - updateRecognitionResults(recognitionResults: Windows.Foundation.Collections.IVectorView): void; - getStrokes(): Windows.Foundation.Collections.IVectorView; - getRecognitionResults(): Windows.Foundation.Collections.IVectorView; - } - export class InkStrokeContainer implements Windows.UI.Input.Inking.IInkStrokeContainer { - boundingRect: Windows.Foundation.Rect; - addStroke(stroke: Windows.UI.Input.Inking.InkStroke): void; - deleteSelected(): Windows.Foundation.Rect; - moveSelected(translation: Windows.Foundation.Point): Windows.Foundation.Rect; - selectWithPolyLine(polyline: Windows.Foundation.Collections.IIterable): Windows.Foundation.Rect; - selectWithLine(from: Windows.Foundation.Point, to: Windows.Foundation.Point): Windows.Foundation.Rect; - copySelectedToClipboard(): void; - pasteFromClipboard(position: Windows.Foundation.Point): Windows.Foundation.Rect; - canPasteFromClipboard(): boolean; - loadAsync(inputStream: Windows.Storage.Streams.IInputStream): Windows.Foundation.IAsyncActionWithProgress; - saveAsync(outputStream: Windows.Storage.Streams.IOutputStream): Windows.Foundation.IAsyncOperationWithProgress; - updateRecognitionResults(recognitionResults: Windows.Foundation.Collections.IVectorView): void; - getStrokes(): Windows.Foundation.Collections.IVectorView; - getRecognitionResults(): Windows.Foundation.Collections.IVectorView; - } - export interface IInkRecognizer { - name: string; - } - export class InkRecognizer implements Windows.UI.Input.Inking.IInkRecognizer { - name: string; - } - export interface IInkRecognizerContainer { - setDefaultRecognizer(recognizer: Windows.UI.Input.Inking.InkRecognizer): void; - recognizeAsync(strokeCollection: Windows.UI.Input.Inking.InkStrokeContainer, recognitionTarget: Windows.UI.Input.Inking.InkRecognitionTarget): Windows.Foundation.IAsyncOperation>; - getRecognizers(): Windows.Foundation.Collections.IVectorView; - } - export class InkRecognizerContainer implements Windows.UI.Input.Inking.IInkRecognizerContainer { - setDefaultRecognizer(recognizer: Windows.UI.Input.Inking.InkRecognizer): void; - recognizeAsync(strokeCollection: Windows.UI.Input.Inking.InkStrokeContainer, recognitionTarget: Windows.UI.Input.Inking.InkRecognitionTarget): Windows.Foundation.IAsyncOperation>; - getRecognizers(): Windows.Foundation.Collections.IVectorView; - } - export interface IInkManager extends Windows.UI.Input.Inking.IInkStrokeContainer, Windows.UI.Input.Inking.IInkRecognizerContainer { - mode: Windows.UI.Input.Inking.InkManipulationMode; - processPointerDown(pointerPoint: Windows.UI.Input.PointerPoint): void; - processPointerUpdate(pointerPoint: Windows.UI.Input.PointerPoint): any; - processPointerUp(pointerPoint: Windows.UI.Input.PointerPoint): Windows.Foundation.Rect; - setDefaultDrawingAttributes(drawingAttributes: Windows.UI.Input.Inking.InkDrawingAttributes): void; - recognizeAsync(strokeCollection: Windows.UI.Input.Inking.InkStrokeContainer, recognitionTarget: Windows.UI.Input.Inking.InkRecognitionTarget): Windows.Foundation.IAsyncOperation>; - recognizeAsync(recognitionTarget: Windows.UI.Input.Inking.InkRecognitionTarget): Windows.Foundation.IAsyncOperation>; - } - export class InkManager implements Windows.UI.Input.Inking.IInkManager, Windows.UI.Input.Inking.IInkStrokeContainer, Windows.UI.Input.Inking.IInkRecognizerContainer { - mode: Windows.UI.Input.Inking.InkManipulationMode; - boundingRect: Windows.Foundation.Rect; - processPointerDown(pointerPoint: Windows.UI.Input.PointerPoint): void; - processPointerUpdate(pointerPoint: Windows.UI.Input.PointerPoint): any; - processPointerUp(pointerPoint: Windows.UI.Input.PointerPoint): Windows.Foundation.Rect; - setDefaultDrawingAttributes(drawingAttributes: Windows.UI.Input.Inking.InkDrawingAttributes): void; - recognizeAsync(recognitionTarget: Windows.UI.Input.Inking.InkRecognitionTarget): Windows.Foundation.IAsyncOperation>; - addStroke(stroke: Windows.UI.Input.Inking.InkStroke): void; - deleteSelected(): Windows.Foundation.Rect; - moveSelected(translation: Windows.Foundation.Point): Windows.Foundation.Rect; - selectWithPolyLine(polyline: Windows.Foundation.Collections.IIterable): Windows.Foundation.Rect; - selectWithLine(from: Windows.Foundation.Point, to: Windows.Foundation.Point): Windows.Foundation.Rect; - copySelectedToClipboard(): void; - pasteFromClipboard(position: Windows.Foundation.Point): Windows.Foundation.Rect; - canPasteFromClipboard(): boolean; - loadAsync(inputStream: Windows.Storage.Streams.IInputStream): Windows.Foundation.IAsyncActionWithProgress; - saveAsync(outputStream: Windows.Storage.Streams.IOutputStream): Windows.Foundation.IAsyncOperationWithProgress; - updateRecognitionResults(recognitionResults: Windows.Foundation.Collections.IVectorView): void; - getStrokes(): Windows.Foundation.Collections.IVectorView; - getRecognitionResults(): Windows.Foundation.Collections.IVectorView; - setDefaultRecognizer(recognizer: Windows.UI.Input.Inking.InkRecognizer): void; - recognizeAsync(strokeCollection: Windows.UI.Input.Inking.InkStrokeContainer, recognitionTarget: Windows.UI.Input.Inking.InkRecognitionTarget): Windows.Foundation.IAsyncOperation>; - getRecognizers(): Windows.Foundation.Collections.IVectorView; - } - } - } - } -} -declare module Windows { - export module UI { - export module WebUI { - export interface IActivatedDeferral { - complete(): void; - } - export class ActivatedDeferral implements Windows.UI.WebUI.IActivatedDeferral { - complete(): void; - } - export interface IActivatedOperation { - getDeferral(): Windows.UI.WebUI.ActivatedDeferral; - } - export class ActivatedOperation implements Windows.UI.WebUI.IActivatedOperation { - getDeferral(): Windows.UI.WebUI.ActivatedDeferral; - } - export interface IActivatedEventArgsDeferral { - activatedOperation: Windows.UI.WebUI.ActivatedOperation; - } - export class WebUILaunchActivatedEventArgs implements Windows.ApplicationModel.Activation.ILaunchActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs, Windows.UI.WebUI.IActivatedEventArgsDeferral { - arguments: string; - tileId: string; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - activatedOperation: Windows.UI.WebUI.ActivatedOperation; - } - export class WebUISearchActivatedEventArgs implements Windows.ApplicationModel.Activation.ISearchActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs, Windows.UI.WebUI.IActivatedEventArgsDeferral { - language: string; - queryText: string; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - activatedOperation: Windows.UI.WebUI.ActivatedOperation; - } - export class WebUIShareTargetActivatedEventArgs implements Windows.ApplicationModel.Activation.IShareTargetActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs, Windows.UI.WebUI.IActivatedEventArgsDeferral { - shareOperation: Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - activatedOperation: Windows.UI.WebUI.ActivatedOperation; - } - export class WebUIFileActivatedEventArgs implements Windows.ApplicationModel.Activation.IFileActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs, Windows.UI.WebUI.IActivatedEventArgsDeferral { - files: Windows.Foundation.Collections.IVectorView; - verb: string; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - activatedOperation: Windows.UI.WebUI.ActivatedOperation; - } - export class WebUIProtocolActivatedEventArgs implements Windows.ApplicationModel.Activation.IProtocolActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs, Windows.UI.WebUI.IActivatedEventArgsDeferral { - uri: Windows.Foundation.Uri; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - activatedOperation: Windows.UI.WebUI.ActivatedOperation; - } - export class WebUIFileOpenPickerActivatedEventArgs implements Windows.ApplicationModel.Activation.IFileOpenPickerActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs, Windows.UI.WebUI.IActivatedEventArgsDeferral { - fileOpenPickerUI: Windows.Storage.Pickers.Provider.FileOpenPickerUI; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - activatedOperation: Windows.UI.WebUI.ActivatedOperation; - } - export class WebUIFileSavePickerActivatedEventArgs implements Windows.ApplicationModel.Activation.IFileSavePickerActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs, Windows.UI.WebUI.IActivatedEventArgsDeferral { - fileSavePickerUI: Windows.Storage.Pickers.Provider.FileSavePickerUI; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - activatedOperation: Windows.UI.WebUI.ActivatedOperation; - } - export class WebUICachedFileUpdaterActivatedEventArgs implements Windows.ApplicationModel.Activation.ICachedFileUpdaterActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs, Windows.UI.WebUI.IActivatedEventArgsDeferral { - cachedFileUpdaterUI: Windows.Storage.Provider.CachedFileUpdaterUI; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - activatedOperation: Windows.UI.WebUI.ActivatedOperation; - } - export class WebUIContactPickerActivatedEventArgs implements Windows.ApplicationModel.Activation.IContactPickerActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs, Windows.UI.WebUI.IActivatedEventArgsDeferral { - contactPickerUI: Windows.ApplicationModel.Contacts.Provider.ContactPickerUI; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - activatedOperation: Windows.UI.WebUI.ActivatedOperation; - } - export class WebUIDeviceActivatedEventArgs implements Windows.ApplicationModel.Activation.IDeviceActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs, Windows.UI.WebUI.IActivatedEventArgsDeferral { - deviceInformationId: string; - verb: string; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - activatedOperation: Windows.UI.WebUI.ActivatedOperation; - } - export class WebUIPrintTaskSettingsActivatedEventArgs implements Windows.ApplicationModel.Activation.IPrintTaskSettingsActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs, Windows.UI.WebUI.IActivatedEventArgsDeferral { - configuration: Windows.Devices.Printers.Extensions.PrintTaskConfiguration; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - activatedOperation: Windows.UI.WebUI.ActivatedOperation; - } - export class WebUICameraSettingsActivatedEventArgs implements Windows.ApplicationModel.Activation.ICameraSettingsActivatedEventArgs, Windows.ApplicationModel.Activation.IActivatedEventArgs, Windows.UI.WebUI.IActivatedEventArgsDeferral { - videoDeviceController: any; - videoDeviceExtension: any; - kind: Windows.ApplicationModel.Activation.ActivationKind; - previousExecutionState: Windows.ApplicationModel.Activation.ApplicationExecutionState; - splashScreen: Windows.ApplicationModel.Activation.SplashScreen; - activatedOperation: Windows.UI.WebUI.ActivatedOperation; - } - export interface ActivatedEventHandler { - (sender: any, eventArgs: Windows.ApplicationModel.Activation.IActivatedEventArgs): void; - } - export interface ResumingEventHandler { - (sender: any): void; - } - export interface SuspendingEventHandler { - (sender: any, e: Windows.ApplicationModel.ISuspendingEventArgs): void; - } - export interface NavigatedEventHandler { - (sender: any, e: Windows.UI.WebUI.IWebUINavigatedEventArgs): void; - } - export interface IWebUINavigatedEventArgs { - navigatedOperation: Windows.UI.WebUI.WebUINavigatedOperation; - } - export class WebUINavigatedOperation implements Windows.UI.WebUI.IWebUINavigatedOperation { - getDeferral(): Windows.UI.WebUI.WebUINavigatedDeferral; - } - export class SuspendingDeferral implements Windows.ApplicationModel.ISuspendingDeferral { - complete(): void; - } - export class SuspendingOperation implements Windows.ApplicationModel.ISuspendingOperation { - deadline: Date; - getDeferral(): Windows.ApplicationModel.SuspendingDeferral; - } - export class SuspendingEventArgs implements Windows.ApplicationModel.ISuspendingEventArgs { - suspendingOperation: Windows.ApplicationModel.SuspendingOperation; - } - export interface IWebUIBackgroundTaskInstance { - succeeded: boolean; - } - export interface IWebUIBackgroundTaskInstanceStatics { - current: Windows.UI.WebUI.IWebUIBackgroundTaskInstance; - } - export class WebUIBackgroundTaskInstanceRuntimeClass implements Windows.UI.WebUI.IWebUIBackgroundTaskInstance, Windows.ApplicationModel.Background.IBackgroundTaskInstance { - succeeded: boolean; - instanceId: string; - progress: number; - suspendedCount: number; - task: Windows.ApplicationModel.Background.BackgroundTaskRegistration; - triggerDetails: any; - oncanceled: any/* TODO */; - getDeferral(): Windows.ApplicationModel.Background.BackgroundTaskDeferral; - } - export class WebUIBackgroundTaskInstance { - static current: Windows.UI.WebUI.IWebUIBackgroundTaskInstance; - } - export interface IWebUINavigatedDeferral { - complete(): void; - } - export class WebUINavigatedDeferral implements Windows.UI.WebUI.IWebUINavigatedDeferral { - complete(): void; - } - export interface IWebUINavigatedOperation { - getDeferral(): Windows.UI.WebUI.WebUINavigatedDeferral; - } - export class WebUINavigatedEventArgs implements Windows.UI.WebUI.IWebUINavigatedEventArgs { - navigatedOperation: Windows.UI.WebUI.WebUINavigatedOperation; - } - export interface IWebUIActivationStatics { - onactivated: any/* TODO */; - onsuspending: any/* TODO */; - onresuming: any/* TODO */; - onnavigated: any/* TODO */; - } - export class WebUIApplication { - static onactivated: any/* TODO */; - static onsuspending: any/* TODO */; - static onresuming: any/* TODO */; - static onnavigated: any/* TODO */; - } - } - } -} -declare module Windows { - export module UI { - export interface IColors { - } - export interface IColorsStatics { - aliceBlue: Windows.UI.Color; - antiqueWhite: Windows.UI.Color; - aqua: Windows.UI.Color; - aquamarine: Windows.UI.Color; - azure: Windows.UI.Color; - beige: Windows.UI.Color; - bisque: Windows.UI.Color; - black: Windows.UI.Color; - blanchedAlmond: Windows.UI.Color; - blue: Windows.UI.Color; - blueViolet: Windows.UI.Color; - brown: Windows.UI.Color; - burlyWood: Windows.UI.Color; - cadetBlue: Windows.UI.Color; - chartreuse: Windows.UI.Color; - chocolate: Windows.UI.Color; - coral: Windows.UI.Color; - cornflowerBlue: Windows.UI.Color; - cornsilk: Windows.UI.Color; - crimson: Windows.UI.Color; - cyan: Windows.UI.Color; - darkBlue: Windows.UI.Color; - darkCyan: Windows.UI.Color; - darkGoldenrod: Windows.UI.Color; - darkGray: Windows.UI.Color; - darkGreen: Windows.UI.Color; - darkKhaki: Windows.UI.Color; - darkMagenta: Windows.UI.Color; - darkOliveGreen: Windows.UI.Color; - darkOrange: Windows.UI.Color; - darkOrchid: Windows.UI.Color; - darkRed: Windows.UI.Color; - darkSalmon: Windows.UI.Color; - darkSeaGreen: Windows.UI.Color; - darkSlateBlue: Windows.UI.Color; - darkSlateGray: Windows.UI.Color; - darkTurquoise: Windows.UI.Color; - darkViolet: Windows.UI.Color; - deepPink: Windows.UI.Color; - deepSkyBlue: Windows.UI.Color; - dimGray: Windows.UI.Color; - dodgerBlue: Windows.UI.Color; - firebrick: Windows.UI.Color; - floralWhite: Windows.UI.Color; - forestGreen: Windows.UI.Color; - fuchsia: Windows.UI.Color; - gainsboro: Windows.UI.Color; - ghostWhite: Windows.UI.Color; - gold: Windows.UI.Color; - goldenrod: Windows.UI.Color; - gray: Windows.UI.Color; - green: Windows.UI.Color; - greenYellow: Windows.UI.Color; - honeydew: Windows.UI.Color; - hotPink: Windows.UI.Color; - indianRed: Windows.UI.Color; - indigo: Windows.UI.Color; - ivory: Windows.UI.Color; - khaki: Windows.UI.Color; - lavender: Windows.UI.Color; - lavenderBlush: Windows.UI.Color; - lawnGreen: Windows.UI.Color; - lemonChiffon: Windows.UI.Color; - lightBlue: Windows.UI.Color; - lightCoral: Windows.UI.Color; - lightCyan: Windows.UI.Color; - lightGoldenrodYellow: Windows.UI.Color; - lightGray: Windows.UI.Color; - lightGreen: Windows.UI.Color; - lightPink: Windows.UI.Color; - lightSalmon: Windows.UI.Color; - lightSeaGreen: Windows.UI.Color; - lightSkyBlue: Windows.UI.Color; - lightSlateGray: Windows.UI.Color; - lightSteelBlue: Windows.UI.Color; - lightYellow: Windows.UI.Color; - lime: Windows.UI.Color; - limeGreen: Windows.UI.Color; - linen: Windows.UI.Color; - magenta: Windows.UI.Color; - maroon: Windows.UI.Color; - mediumAquamarine: Windows.UI.Color; - mediumBlue: Windows.UI.Color; - mediumOrchid: Windows.UI.Color; - mediumPurple: Windows.UI.Color; - mediumSeaGreen: Windows.UI.Color; - mediumSlateBlue: Windows.UI.Color; - mediumSpringGreen: Windows.UI.Color; - mediumTurquoise: Windows.UI.Color; - mediumVioletRed: Windows.UI.Color; - midnightBlue: Windows.UI.Color; - mintCream: Windows.UI.Color; - mistyRose: Windows.UI.Color; - moccasin: Windows.UI.Color; - navajoWhite: Windows.UI.Color; - navy: Windows.UI.Color; - oldLace: Windows.UI.Color; - olive: Windows.UI.Color; - oliveDrab: Windows.UI.Color; - orange: Windows.UI.Color; - orangeRed: Windows.UI.Color; - orchid: Windows.UI.Color; - paleGoldenrod: Windows.UI.Color; - paleGreen: Windows.UI.Color; - paleTurquoise: Windows.UI.Color; - paleVioletRed: Windows.UI.Color; - papayaWhip: Windows.UI.Color; - peachPuff: Windows.UI.Color; - peru: Windows.UI.Color; - pink: Windows.UI.Color; - plum: Windows.UI.Color; - powderBlue: Windows.UI.Color; - purple: Windows.UI.Color; - red: Windows.UI.Color; - rosyBrown: Windows.UI.Color; - royalBlue: Windows.UI.Color; - saddleBrown: Windows.UI.Color; - salmon: Windows.UI.Color; - sandyBrown: Windows.UI.Color; - seaGreen: Windows.UI.Color; - seaShell: Windows.UI.Color; - sienna: Windows.UI.Color; - silver: Windows.UI.Color; - skyBlue: Windows.UI.Color; - slateBlue: Windows.UI.Color; - slateGray: Windows.UI.Color; - snow: Windows.UI.Color; - springGreen: Windows.UI.Color; - steelBlue: Windows.UI.Color; - tan: Windows.UI.Color; - teal: Windows.UI.Color; - thistle: Windows.UI.Color; - tomato: Windows.UI.Color; - transparent: Windows.UI.Color; - turquoise: Windows.UI.Color; - violet: Windows.UI.Color; - wheat: Windows.UI.Color; - white: Windows.UI.Color; - whiteSmoke: Windows.UI.Color; - yellow: Windows.UI.Color; - yellowGreen: Windows.UI.Color; - } - export class Colors implements Windows.UI.IColors { - static aliceBlue: Windows.UI.Color; - static antiqueWhite: Windows.UI.Color; - static aqua: Windows.UI.Color; - static aquamarine: Windows.UI.Color; - static azure: Windows.UI.Color; - static beige: Windows.UI.Color; - static bisque: Windows.UI.Color; - static black: Windows.UI.Color; - static blanchedAlmond: Windows.UI.Color; - static blue: Windows.UI.Color; - static blueViolet: Windows.UI.Color; - static brown: Windows.UI.Color; - static burlyWood: Windows.UI.Color; - static cadetBlue: Windows.UI.Color; - static chartreuse: Windows.UI.Color; - static chocolate: Windows.UI.Color; - static coral: Windows.UI.Color; - static cornflowerBlue: Windows.UI.Color; - static cornsilk: Windows.UI.Color; - static crimson: Windows.UI.Color; - static cyan: Windows.UI.Color; - static darkBlue: Windows.UI.Color; - static darkCyan: Windows.UI.Color; - static darkGoldenrod: Windows.UI.Color; - static darkGray: Windows.UI.Color; - static darkGreen: Windows.UI.Color; - static darkKhaki: Windows.UI.Color; - static darkMagenta: Windows.UI.Color; - static darkOliveGreen: Windows.UI.Color; - static darkOrange: Windows.UI.Color; - static darkOrchid: Windows.UI.Color; - static darkRed: Windows.UI.Color; - static darkSalmon: Windows.UI.Color; - static darkSeaGreen: Windows.UI.Color; - static darkSlateBlue: Windows.UI.Color; - static darkSlateGray: Windows.UI.Color; - static darkTurquoise: Windows.UI.Color; - static darkViolet: Windows.UI.Color; - static deepPink: Windows.UI.Color; - static deepSkyBlue: Windows.UI.Color; - static dimGray: Windows.UI.Color; - static dodgerBlue: Windows.UI.Color; - static firebrick: Windows.UI.Color; - static floralWhite: Windows.UI.Color; - static forestGreen: Windows.UI.Color; - static fuchsia: Windows.UI.Color; - static gainsboro: Windows.UI.Color; - static ghostWhite: Windows.UI.Color; - static gold: Windows.UI.Color; - static goldenrod: Windows.UI.Color; - static gray: Windows.UI.Color; - static green: Windows.UI.Color; - static greenYellow: Windows.UI.Color; - static honeydew: Windows.UI.Color; - static hotPink: Windows.UI.Color; - static indianRed: Windows.UI.Color; - static indigo: Windows.UI.Color; - static ivory: Windows.UI.Color; - static khaki: Windows.UI.Color; - static lavender: Windows.UI.Color; - static lavenderBlush: Windows.UI.Color; - static lawnGreen: Windows.UI.Color; - static lemonChiffon: Windows.UI.Color; - static lightBlue: Windows.UI.Color; - static lightCoral: Windows.UI.Color; - static lightCyan: Windows.UI.Color; - static lightGoldenrodYellow: Windows.UI.Color; - static lightGray: Windows.UI.Color; - static lightGreen: Windows.UI.Color; - static lightPink: Windows.UI.Color; - static lightSalmon: Windows.UI.Color; - static lightSeaGreen: Windows.UI.Color; - static lightSkyBlue: Windows.UI.Color; - static lightSlateGray: Windows.UI.Color; - static lightSteelBlue: Windows.UI.Color; - static lightYellow: Windows.UI.Color; - static lime: Windows.UI.Color; - static limeGreen: Windows.UI.Color; - static linen: Windows.UI.Color; - static magenta: Windows.UI.Color; - static maroon: Windows.UI.Color; - static mediumAquamarine: Windows.UI.Color; - static mediumBlue: Windows.UI.Color; - static mediumOrchid: Windows.UI.Color; - static mediumPurple: Windows.UI.Color; - static mediumSeaGreen: Windows.UI.Color; - static mediumSlateBlue: Windows.UI.Color; - static mediumSpringGreen: Windows.UI.Color; - static mediumTurquoise: Windows.UI.Color; - static mediumVioletRed: Windows.UI.Color; - static midnightBlue: Windows.UI.Color; - static mintCream: Windows.UI.Color; - static mistyRose: Windows.UI.Color; - static moccasin: Windows.UI.Color; - static navajoWhite: Windows.UI.Color; - static navy: Windows.UI.Color; - static oldLace: Windows.UI.Color; - static olive: Windows.UI.Color; - static oliveDrab: Windows.UI.Color; - static orange: Windows.UI.Color; - static orangeRed: Windows.UI.Color; - static orchid: Windows.UI.Color; - static paleGoldenrod: Windows.UI.Color; - static paleGreen: Windows.UI.Color; - static paleTurquoise: Windows.UI.Color; - static paleVioletRed: Windows.UI.Color; - static papayaWhip: Windows.UI.Color; - static peachPuff: Windows.UI.Color; - static peru: Windows.UI.Color; - static pink: Windows.UI.Color; - static plum: Windows.UI.Color; - static powderBlue: Windows.UI.Color; - static purple: Windows.UI.Color; - static red: Windows.UI.Color; - static rosyBrown: Windows.UI.Color; - static royalBlue: Windows.UI.Color; - static saddleBrown: Windows.UI.Color; - static salmon: Windows.UI.Color; - static sandyBrown: Windows.UI.Color; - static seaGreen: Windows.UI.Color; - static seaShell: Windows.UI.Color; - static sienna: Windows.UI.Color; - static silver: Windows.UI.Color; - static skyBlue: Windows.UI.Color; - static slateBlue: Windows.UI.Color; - static slateGray: Windows.UI.Color; - static snow: Windows.UI.Color; - static springGreen: Windows.UI.Color; - static steelBlue: Windows.UI.Color; - static tan: Windows.UI.Color; - static teal: Windows.UI.Color; - static thistle: Windows.UI.Color; - static tomato: Windows.UI.Color; - static transparent: Windows.UI.Color; - static turquoise: Windows.UI.Color; - static violet: Windows.UI.Color; - static wheat: Windows.UI.Color; - static white: Windows.UI.Color; - static whiteSmoke: Windows.UI.Color; - static yellow: Windows.UI.Color; - static yellowGreen: Windows.UI.Color; - } - export interface Color { - a: number; - r: number; - g: number; - b: number; - } - export interface IColorHelper { - } - export interface IColorHelperStatics { - fromArgb(a: number, r: number, g: number, b: number): Windows.UI.Color; - } - export class ColorHelper implements Windows.UI.IColorHelper { - static fromArgb(a: number, r: number, g: number, b: number): Windows.UI.Color; - } - } -} -declare module Windows { - export module UI { - export module Notifications { - export enum NotificationSetting { - enabled, - disabledForApplication, - disabledForUser, - disabledByGroupPolicy, - disabledByManifest, - } - export enum ToastDismissalReason { - userCanceled, - applicationHidden, - timedOut, - } - export enum BadgeTemplateType { - badgeGlyph, - badgeNumber, - } - export enum TileTemplateType { - tileSquareImage, - tileSquareBlock, - tileSquareText01, - tileSquareText02, - tileSquareText03, - tileSquareText04, - tileSquarePeekImageAndText01, - tileSquarePeekImageAndText02, - tileSquarePeekImageAndText03, - tileSquarePeekImageAndText04, - tileWideImage, - tileWideImageCollection, - tileWideImageAndText01, - tileWideImageAndText02, - tileWideBlockAndText01, - tileWideBlockAndText02, - tileWidePeekImageCollection01, - tileWidePeekImageCollection02, - tileWidePeekImageCollection03, - tileWidePeekImageCollection04, - tileWidePeekImageCollection05, - tileWidePeekImageCollection06, - tileWidePeekImageAndText01, - tileWidePeekImageAndText02, - tileWidePeekImage01, - tileWidePeekImage02, - tileWidePeekImage03, - tileWidePeekImage04, - tileWidePeekImage05, - tileWidePeekImage06, - tileWideSmallImageAndText01, - tileWideSmallImageAndText02, - tileWideSmallImageAndText03, - tileWideSmallImageAndText04, - tileWideSmallImageAndText05, - tileWideText01, - tileWideText02, - tileWideText03, - tileWideText04, - tileWideText05, - tileWideText06, - tileWideText07, - tileWideText08, - tileWideText09, - tileWideText10, - tileWideText11, - } - export enum ToastTemplateType { - toastImageAndText01, - toastImageAndText02, - toastImageAndText03, - toastImageAndText04, - toastText01, - toastText02, - toastText03, - toastText04, - } - export enum PeriodicUpdateRecurrence { - halfHour, - hour, - sixHours, - twelveHours, - daily, - } - export interface IToastDismissedEventArgs { - reason: Windows.UI.Notifications.ToastDismissalReason; - } - export interface IToastFailedEventArgs { - errorCode: number; - } - export interface ITileUpdateManagerStatics { - createTileUpdaterForApplication(): Windows.UI.Notifications.TileUpdater; - createTileUpdaterForApplication(applicationId: string): Windows.UI.Notifications.TileUpdater; - createTileUpdaterForSecondaryTile(tileId: string): Windows.UI.Notifications.TileUpdater; - getTemplateContent(type: Windows.UI.Notifications.TileTemplateType): Windows.Data.Xml.Dom.XmlDocument; - } - export class TileUpdater implements Windows.UI.Notifications.ITileUpdater { - setting: Windows.UI.Notifications.NotificationSetting; - update(notification: Windows.UI.Notifications.TileNotification): void; - clear(): void; - enableNotificationQueue(enable: boolean): void; - addToSchedule(scheduledTile: Windows.UI.Notifications.ScheduledTileNotification): void; - removeFromSchedule(scheduledTile: Windows.UI.Notifications.ScheduledTileNotification): void; - getScheduledTileNotifications(): Windows.Foundation.Collections.IVectorView; - startPeriodicUpdate(tileContent: Windows.Foundation.Uri, requestedInterval: Windows.UI.Notifications.PeriodicUpdateRecurrence): void; - startPeriodicUpdate(tileContent: Windows.Foundation.Uri, startTime: Date, requestedInterval: Windows.UI.Notifications.PeriodicUpdateRecurrence): void; - stopPeriodicUpdate(): void; - startPeriodicUpdateBatch(tileContents: Windows.Foundation.Collections.IIterable, requestedInterval: Windows.UI.Notifications.PeriodicUpdateRecurrence): void; - startPeriodicUpdateBatch(tileContents: Windows.Foundation.Collections.IIterable, startTime: Date, requestedInterval: Windows.UI.Notifications.PeriodicUpdateRecurrence): void; - } - export interface ITileUpdater { - setting: Windows.UI.Notifications.NotificationSetting; - update(notification: Windows.UI.Notifications.TileNotification): void; - clear(): void; - enableNotificationQueue(enable: boolean): void; - addToSchedule(scheduledTile: Windows.UI.Notifications.ScheduledTileNotification): void; - removeFromSchedule(scheduledTile: Windows.UI.Notifications.ScheduledTileNotification): void; - getScheduledTileNotifications(): Windows.Foundation.Collections.IVectorView; - startPeriodicUpdate(tileContent: Windows.Foundation.Uri, requestedInterval: Windows.UI.Notifications.PeriodicUpdateRecurrence): void; - startPeriodicUpdate(tileContent: Windows.Foundation.Uri, startTime: Date, requestedInterval: Windows.UI.Notifications.PeriodicUpdateRecurrence): void; - stopPeriodicUpdate(): void; - startPeriodicUpdateBatch(tileContents: Windows.Foundation.Collections.IIterable, requestedInterval: Windows.UI.Notifications.PeriodicUpdateRecurrence): void; - startPeriodicUpdateBatch(tileContents: Windows.Foundation.Collections.IIterable, startTime: Date, requestedInterval: Windows.UI.Notifications.PeriodicUpdateRecurrence): void; - } - export class TileNotification implements Windows.UI.Notifications.ITileNotification { - constructor(content: Windows.Data.Xml.Dom.XmlDocument); - content: Windows.Data.Xml.Dom.XmlDocument; - expirationTime: Date; - tag: string; - } - export class ScheduledTileNotification implements Windows.UI.Notifications.IScheduledTileNotification { - constructor(content: Windows.Data.Xml.Dom.XmlDocument, deliveryTime: Date); - content: Windows.Data.Xml.Dom.XmlDocument; - deliveryTime: Date; - expirationTime: Date; - id: string; - tag: string; - } - export interface IBadgeUpdateManagerStatics { - createBadgeUpdaterForApplication(): Windows.UI.Notifications.BadgeUpdater; - createBadgeUpdaterForApplication(applicationId: string): Windows.UI.Notifications.BadgeUpdater; - createBadgeUpdaterForSecondaryTile(tileId: string): Windows.UI.Notifications.BadgeUpdater; - getTemplateContent(type: Windows.UI.Notifications.BadgeTemplateType): Windows.Data.Xml.Dom.XmlDocument; - } - export class BadgeUpdater implements Windows.UI.Notifications.IBadgeUpdater { - update(notification: Windows.UI.Notifications.BadgeNotification): void; - clear(): void; - startPeriodicUpdate(badgeContent: Windows.Foundation.Uri, requestedInterval: Windows.UI.Notifications.PeriodicUpdateRecurrence): void; - startPeriodicUpdate(badgeContent: Windows.Foundation.Uri, startTime: Date, requestedInterval: Windows.UI.Notifications.PeriodicUpdateRecurrence): void; - stopPeriodicUpdate(): void; - } - export interface IBadgeUpdater { - update(notification: Windows.UI.Notifications.BadgeNotification): void; - clear(): void; - startPeriodicUpdate(badgeContent: Windows.Foundation.Uri, requestedInterval: Windows.UI.Notifications.PeriodicUpdateRecurrence): void; - startPeriodicUpdate(badgeContent: Windows.Foundation.Uri, startTime: Date, requestedInterval: Windows.UI.Notifications.PeriodicUpdateRecurrence): void; - stopPeriodicUpdate(): void; - } - export class BadgeNotification implements Windows.UI.Notifications.IBadgeNotification { - constructor(content: Windows.Data.Xml.Dom.XmlDocument); - content: Windows.Data.Xml.Dom.XmlDocument; - expirationTime: Date; - } - export interface IToastNotificationManagerStatics { - createToastNotifier(): Windows.UI.Notifications.ToastNotifier; - createToastNotifier(applicationId: string): Windows.UI.Notifications.ToastNotifier; - getTemplateContent(type: Windows.UI.Notifications.ToastTemplateType): Windows.Data.Xml.Dom.XmlDocument; - } - export class ToastNotifier implements Windows.UI.Notifications.IToastNotifier { - setting: Windows.UI.Notifications.NotificationSetting; - show(notification: Windows.UI.Notifications.ToastNotification): void; - hide(notification: Windows.UI.Notifications.ToastNotification): void; - addToSchedule(scheduledToast: Windows.UI.Notifications.ScheduledToastNotification): void; - removeFromSchedule(scheduledToast: Windows.UI.Notifications.ScheduledToastNotification): void; - getScheduledToastNotifications(): Windows.Foundation.Collections.IVectorView; - } - export interface IToastNotifier { - setting: Windows.UI.Notifications.NotificationSetting; - show(notification: Windows.UI.Notifications.ToastNotification): void; - hide(notification: Windows.UI.Notifications.ToastNotification): void; - addToSchedule(scheduledToast: Windows.UI.Notifications.ScheduledToastNotification): void; - removeFromSchedule(scheduledToast: Windows.UI.Notifications.ScheduledToastNotification): void; - getScheduledToastNotifications(): Windows.Foundation.Collections.IVectorView; - } - export class ToastNotification implements Windows.UI.Notifications.IToastNotification { - constructor(content: Windows.Data.Xml.Dom.XmlDocument); - content: Windows.Data.Xml.Dom.XmlDocument; - expirationTime: Date; - ondismissed: any/* TODO */; - onactivated: any/* TODO */; - onfailed: any/* TODO */; - } - export class ScheduledToastNotification implements Windows.UI.Notifications.IScheduledToastNotification { - constructor(content: Windows.Data.Xml.Dom.XmlDocument, deliveryTime: Date); - constructor(content: Windows.Data.Xml.Dom.XmlDocument, deliveryTime: Date, snoozeInterval: number, maximumSnoozeCount: number); - content: Windows.Data.Xml.Dom.XmlDocument; - deliveryTime: Date; - id: string; - maximumSnoozeCount: number; - snoozeInterval: number; - } - export interface ITileNotificationFactory { - createTileNotification(content: Windows.Data.Xml.Dom.XmlDocument): Windows.UI.Notifications.TileNotification; - } - export interface ITileNotification { - content: Windows.Data.Xml.Dom.XmlDocument; - expirationTime: Date; - tag: string; - } - export interface IBadgeNotificationFactory { - createBadgeNotification(content: Windows.Data.Xml.Dom.XmlDocument): Windows.UI.Notifications.BadgeNotification; - } - export interface IBadgeNotification { - content: Windows.Data.Xml.Dom.XmlDocument; - expirationTime: Date; - } - export interface IToastNotificationFactory { - createToastNotification(content: Windows.Data.Xml.Dom.XmlDocument): Windows.UI.Notifications.ToastNotification; - } - export interface IToastNotification { - content: Windows.Data.Xml.Dom.XmlDocument; - expirationTime: Date; - ondismissed: any/* TODO */; - onactivated: any/* TODO */; - onfailed: any/* TODO */; - } - export class ToastDismissedEventArgs implements Windows.UI.Notifications.IToastDismissedEventArgs { - reason: Windows.UI.Notifications.ToastDismissalReason; - } - export class ToastFailedEventArgs implements Windows.UI.Notifications.IToastFailedEventArgs { - errorCode: number; - } - export interface IScheduledToastNotificationFactory { - createScheduledToastNotification(content: Windows.Data.Xml.Dom.XmlDocument, deliveryTime: Date): Windows.UI.Notifications.ScheduledToastNotification; - createScheduledToastNotification(content: Windows.Data.Xml.Dom.XmlDocument, deliveryTime: Date, snoozeInterval: number, maximumSnoozeCount: number): Windows.UI.Notifications.ScheduledToastNotification; - } - export interface IScheduledToastNotification { - content: Windows.Data.Xml.Dom.XmlDocument; - deliveryTime: Date; - id: string; - maximumSnoozeCount: number; - snoozeInterval: number; - } - export interface IScheduledTileNotificationFactory { - createScheduledTileNotification(content: Windows.Data.Xml.Dom.XmlDocument, deliveryTime: Date): Windows.UI.Notifications.ScheduledTileNotification; - } - export interface IScheduledTileNotification { - content: Windows.Data.Xml.Dom.XmlDocument; - deliveryTime: Date; - expirationTime: Date; - id: string; - tag: string; - } - export class TileUpdateManager { - static createTileUpdaterForApplication(): Windows.UI.Notifications.TileUpdater; - static createTileUpdaterForApplication(applicationId: string): Windows.UI.Notifications.TileUpdater; - static createTileUpdaterForSecondaryTile(tileId: string): Windows.UI.Notifications.TileUpdater; - static getTemplateContent(type: Windows.UI.Notifications.TileTemplateType): Windows.Data.Xml.Dom.XmlDocument; - } - export class BadgeUpdateManager { - static createBadgeUpdaterForApplication(): Windows.UI.Notifications.BadgeUpdater; - static createBadgeUpdaterForApplication(applicationId: string): Windows.UI.Notifications.BadgeUpdater; - static createBadgeUpdaterForSecondaryTile(tileId: string): Windows.UI.Notifications.BadgeUpdater; - static getTemplateContent(type: Windows.UI.Notifications.BadgeTemplateType): Windows.Data.Xml.Dom.XmlDocument; - } - export class ToastNotificationManager { - static createToastNotifier(): Windows.UI.Notifications.ToastNotifier; - static createToastNotifier(applicationId: string): Windows.UI.Notifications.ToastNotifier; - static getTemplateContent(type: Windows.UI.Notifications.ToastTemplateType): Windows.Data.Xml.Dom.XmlDocument; - } - } - } -} -declare module Windows { - export module Web { - export enum WebErrorStatus { - unknown, - certificateCommonNameIsIncorrect, - certificateExpired, - certificateContainsErrors, - certificateRevoked, - certificateIsInvalid, - serverUnreachable, - timeout, - errorHttpInvalidServerResponse, - connectionAborted, - connectionReset, - disconnected, - httpToHttpsOnRedirection, - httpsToHttpOnRedirection, - cannotConnect, - hostNameNotResolved, - operationCanceled, - redirectFailed, - unexpectedStatusCode, - unexpectedRedirection, - unexpectedClientError, - unexpectedServerError, - multipleChoices, - movedPermanently, - found, - seeOther, - notModified, - useProxy, - temporaryRedirect, - badRequest, - unauthorized, - paymentRequired, - forbidden, - notFound, - methodNotAllowed, - notAcceptable, - proxyAuthenticationRequired, - requestTimeout, - conflict, - gone, - lengthRequired, - preconditionFailed, - requestEntityTooLarge, - requestUriTooLong, - unsupportedMediaType, - requestedRangeNotSatisfiable, - expectationFailed, - internalServerError, - notImplemented, - badGateway, - serviceUnavailable, - gatewayTimeout, - httpVersionNotSupported, - } - export interface IWebErrorStatics { - getStatus(hresult: number): Windows.Web.WebErrorStatus; - } - export class WebError { - static getStatus(hresult: number): Windows.Web.WebErrorStatus; - } - } -} -declare module Windows { - export module Web { - export module Syndication { - export interface RetrievalProgress { - bytesRetrieved: number; - totalBytesToRetrieve: number; - } - export interface TransferProgress { - bytesSent: number; - totalBytesToSend: number; - bytesRetrieved: number; - totalBytesToRetrieve: number; - } - export enum SyndicationFormat { - atom10, - rss20, - rss10, - rss092, - rss091, - atom03, - } - export enum SyndicationErrorStatus { - unknown, - missingRequiredElement, - missingRequiredAttribute, - invalidXml, - unexpectedContent, - unsupportedFormat, - } - export interface ISyndicationAttribute { - name: string; - namespace: string; - value: string; - } - export class SyndicationAttribute implements Windows.Web.Syndication.ISyndicationAttribute { - constructor(attributeName: string, attributeNamespace: string, attributeValue: string); - constructor(); - name: string; - namespace: string; - value: string; - } - export interface ISyndicationAttributeFactory { - createSyndicationAttribute(attributeName: string, attributeNamespace: string, attributeValue: string): Windows.Web.Syndication.SyndicationAttribute; - } - export interface ISyndicationNode { - attributeExtensions: Windows.Foundation.Collections.IVector; - baseUri: Windows.Foundation.Uri; - elementExtensions: Windows.Foundation.Collections.IVector; - language: string; - nodeName: string; - nodeNamespace: string; - nodeValue: string; - getXmlDocument(format: Windows.Web.Syndication.SyndicationFormat): Windows.Data.Xml.Dom.XmlDocument; - } - export class SyndicationNode implements Windows.Web.Syndication.ISyndicationNode { - constructor(nodeName: string, nodeNamespace: string, nodeValue: string); - constructor(); - attributeExtensions: Windows.Foundation.Collections.IVector; - baseUri: Windows.Foundation.Uri; - elementExtensions: Windows.Foundation.Collections.IVector; - language: string; - nodeName: string; - nodeNamespace: string; - nodeValue: string; - getXmlDocument(format: Windows.Web.Syndication.SyndicationFormat): Windows.Data.Xml.Dom.XmlDocument; - } - export interface ISyndicationNodeFactory { - createSyndicationNode(nodeName: string, nodeNamespace: string, nodeValue: string): Windows.Web.Syndication.SyndicationNode; - } - export interface ISyndicationGenerator { - text: string; - uri: Windows.Foundation.Uri; - version: string; - } - export class SyndicationGenerator implements Windows.Web.Syndication.ISyndicationGenerator, Windows.Web.Syndication.ISyndicationNode { - constructor(text: string); - constructor(); - text: string; - uri: Windows.Foundation.Uri; - version: string; - attributeExtensions: Windows.Foundation.Collections.IVector; - baseUri: Windows.Foundation.Uri; - elementExtensions: Windows.Foundation.Collections.IVector; - language: string; - nodeName: string; - nodeNamespace: string; - nodeValue: string; - getXmlDocument(format: Windows.Web.Syndication.SyndicationFormat): Windows.Data.Xml.Dom.XmlDocument; - } - export interface ISyndicationGeneratorFactory { - createSyndicationGenerator(text: string): Windows.Web.Syndication.SyndicationGenerator; - } - export interface ISyndicationText extends Windows.Web.Syndication.ISyndicationNode { - text: string; - type: string; - xml: Windows.Data.Xml.Dom.XmlDocument; - } - export class SyndicationText implements Windows.Web.Syndication.ISyndicationText, Windows.Web.Syndication.ISyndicationNode { - constructor(text: string); - constructor(text: string, type: Windows.Web.Syndication.SyndicationTextType); - constructor(); - text: string; - type: string; - xml: Windows.Data.Xml.Dom.XmlDocument; - attributeExtensions: Windows.Foundation.Collections.IVector; - baseUri: Windows.Foundation.Uri; - elementExtensions: Windows.Foundation.Collections.IVector; - language: string; - nodeName: string; - nodeNamespace: string; - nodeValue: string; - getXmlDocument(format: Windows.Web.Syndication.SyndicationFormat): Windows.Data.Xml.Dom.XmlDocument; - } - export enum SyndicationTextType { - text, - html, - xhtml, - } - export interface ISyndicationTextFactory { - createSyndicationText(text: string): Windows.Web.Syndication.SyndicationText; - createSyndicationText(text: string, type: Windows.Web.Syndication.SyndicationTextType): Windows.Web.Syndication.SyndicationText; - } - export interface ISyndicationContent extends Windows.Web.Syndication.ISyndicationText, Windows.Web.Syndication.ISyndicationNode { - sourceUri: Windows.Foundation.Uri; - } - export class SyndicationContent implements Windows.Web.Syndication.ISyndicationText, Windows.Web.Syndication.ISyndicationNode, Windows.Web.Syndication.ISyndicationContent { - constructor(text: string, type: Windows.Web.Syndication.SyndicationTextType); - constructor(sourceUri: Windows.Foundation.Uri); - constructor(); - text: string; - type: string; - xml: Windows.Data.Xml.Dom.XmlDocument; - attributeExtensions: Windows.Foundation.Collections.IVector; - baseUri: Windows.Foundation.Uri; - elementExtensions: Windows.Foundation.Collections.IVector; - language: string; - nodeName: string; - nodeNamespace: string; - nodeValue: string; - sourceUri: Windows.Foundation.Uri; - getXmlDocument(format: Windows.Web.Syndication.SyndicationFormat): Windows.Data.Xml.Dom.XmlDocument; - } - export interface ISyndicationContentFactory { - createSyndicationContent(text: string, type: Windows.Web.Syndication.SyndicationTextType): Windows.Web.Syndication.SyndicationContent; - createSyndicationContent(sourceUri: Windows.Foundation.Uri): Windows.Web.Syndication.SyndicationContent; - } - export interface ISyndicationLink extends Windows.Web.Syndication.ISyndicationNode { - length: number; - mediaType: string; - relationship: string; - resourceLanguage: string; - title: string; - uri: Windows.Foundation.Uri; - } - export class SyndicationLink implements Windows.Web.Syndication.ISyndicationLink, Windows.Web.Syndication.ISyndicationNode { - constructor(uri: Windows.Foundation.Uri); - constructor(uri: Windows.Foundation.Uri, relationship: string, title: string, mediaType: string, length: number); - constructor(); - length: number; - mediaType: string; - relationship: string; - resourceLanguage: string; - title: string; - uri: Windows.Foundation.Uri; - attributeExtensions: Windows.Foundation.Collections.IVector; - baseUri: Windows.Foundation.Uri; - elementExtensions: Windows.Foundation.Collections.IVector; - language: string; - nodeName: string; - nodeNamespace: string; - nodeValue: string; - getXmlDocument(format: Windows.Web.Syndication.SyndicationFormat): Windows.Data.Xml.Dom.XmlDocument; - } - export interface ISyndicationLinkFactory { - createSyndicationLink(uri: Windows.Foundation.Uri): Windows.Web.Syndication.SyndicationLink; - createSyndicationLink(uri: Windows.Foundation.Uri, relationship: string, title: string, mediaType: string, length: number): Windows.Web.Syndication.SyndicationLink; - } - export interface ISyndicationPerson extends Windows.Web.Syndication.ISyndicationNode { - email: string; - name: string; - uri: Windows.Foundation.Uri; - } - export class SyndicationPerson implements Windows.Web.Syndication.ISyndicationPerson, Windows.Web.Syndication.ISyndicationNode { - constructor(name: string); - constructor(name: string, email: string, uri: Windows.Foundation.Uri); - constructor(); - email: string; - name: string; - uri: Windows.Foundation.Uri; - attributeExtensions: Windows.Foundation.Collections.IVector; - baseUri: Windows.Foundation.Uri; - elementExtensions: Windows.Foundation.Collections.IVector; - language: string; - nodeName: string; - nodeNamespace: string; - nodeValue: string; - getXmlDocument(format: Windows.Web.Syndication.SyndicationFormat): Windows.Data.Xml.Dom.XmlDocument; - } - export interface ISyndicationPersonFactory { - createSyndicationPerson(name: string): Windows.Web.Syndication.SyndicationPerson; - createSyndicationPerson(name: string, email: string, uri: Windows.Foundation.Uri): Windows.Web.Syndication.SyndicationPerson; - } - export interface ISyndicationCategory extends Windows.Web.Syndication.ISyndicationNode { - label: string; - scheme: string; - term: string; - } - export class SyndicationCategory implements Windows.Web.Syndication.ISyndicationCategory, Windows.Web.Syndication.ISyndicationNode { - constructor(term: string); - constructor(term: string, scheme: string, label: string); - constructor(); - label: string; - scheme: string; - term: string; - attributeExtensions: Windows.Foundation.Collections.IVector; - baseUri: Windows.Foundation.Uri; - elementExtensions: Windows.Foundation.Collections.IVector; - language: string; - nodeName: string; - nodeNamespace: string; - nodeValue: string; - getXmlDocument(format: Windows.Web.Syndication.SyndicationFormat): Windows.Data.Xml.Dom.XmlDocument; - } - export interface ISyndicationCategoryFactory { - createSyndicationCategory(term: string): Windows.Web.Syndication.SyndicationCategory; - createSyndicationCategory(term: string, scheme: string, label: string): Windows.Web.Syndication.SyndicationCategory; - } - export interface ISyndicationItem extends Windows.Web.Syndication.ISyndicationNode { - authors: Windows.Foundation.Collections.IVector; - categories: Windows.Foundation.Collections.IVector; - commentsUri: Windows.Foundation.Uri; - content: Windows.Web.Syndication.SyndicationContent; - contributors: Windows.Foundation.Collections.IVector; - eTag: string; - editMediaUri: Windows.Foundation.Uri; - editUri: Windows.Foundation.Uri; - id: string; - itemUri: Windows.Foundation.Uri; - lastUpdatedTime: Date; - links: Windows.Foundation.Collections.IVector; - publishedDate: Date; - rights: Windows.Web.Syndication.ISyndicationText; - source: Windows.Web.Syndication.SyndicationFeed; - summary: Windows.Web.Syndication.ISyndicationText; - title: Windows.Web.Syndication.ISyndicationText; - load(item: string): void; - loadFromXml(itemDocument: Windows.Data.Xml.Dom.XmlDocument): void; - } - export class SyndicationFeed implements Windows.Web.Syndication.ISyndicationFeed, Windows.Web.Syndication.ISyndicationNode { - constructor(title: string, subtitle: string, uri: Windows.Foundation.Uri); - constructor(); - authors: Windows.Foundation.Collections.IVector; - categories: Windows.Foundation.Collections.IVector; - contributors: Windows.Foundation.Collections.IVector; - firstUri: Windows.Foundation.Uri; - generator: Windows.Web.Syndication.SyndicationGenerator; - iconUri: Windows.Foundation.Uri; - id: string; - imageUri: Windows.Foundation.Uri; - items: Windows.Foundation.Collections.IVector; - lastUpdatedTime: Date; - lastUri: Windows.Foundation.Uri; - links: Windows.Foundation.Collections.IVector; - nextUri: Windows.Foundation.Uri; - previousUri: Windows.Foundation.Uri; - rights: Windows.Web.Syndication.ISyndicationText; - sourceFormat: Windows.Web.Syndication.SyndicationFormat; - subtitle: Windows.Web.Syndication.ISyndicationText; - title: Windows.Web.Syndication.ISyndicationText; - attributeExtensions: Windows.Foundation.Collections.IVector; - baseUri: Windows.Foundation.Uri; - elementExtensions: Windows.Foundation.Collections.IVector; - language: string; - nodeName: string; - nodeNamespace: string; - nodeValue: string; - load(feed: string): void; - loadFromXml(feedDocument: Windows.Data.Xml.Dom.XmlDocument): void; - getXmlDocument(format: Windows.Web.Syndication.SyndicationFormat): Windows.Data.Xml.Dom.XmlDocument; - } - export class SyndicationItem implements Windows.Web.Syndication.ISyndicationItem, Windows.Web.Syndication.ISyndicationNode { - constructor(title: string, content: Windows.Web.Syndication.SyndicationContent, uri: Windows.Foundation.Uri); - constructor(); - authors: Windows.Foundation.Collections.IVector; - categories: Windows.Foundation.Collections.IVector; - commentsUri: Windows.Foundation.Uri; - content: Windows.Web.Syndication.SyndicationContent; - contributors: Windows.Foundation.Collections.IVector; - eTag: string; - editMediaUri: Windows.Foundation.Uri; - editUri: Windows.Foundation.Uri; - id: string; - itemUri: Windows.Foundation.Uri; - lastUpdatedTime: Date; - links: Windows.Foundation.Collections.IVector; - publishedDate: Date; - rights: Windows.Web.Syndication.ISyndicationText; - source: Windows.Web.Syndication.SyndicationFeed; - summary: Windows.Web.Syndication.ISyndicationText; - title: Windows.Web.Syndication.ISyndicationText; - attributeExtensions: Windows.Foundation.Collections.IVector; - baseUri: Windows.Foundation.Uri; - elementExtensions: Windows.Foundation.Collections.IVector; - language: string; - nodeName: string; - nodeNamespace: string; - nodeValue: string; - load(item: string): void; - loadFromXml(itemDocument: Windows.Data.Xml.Dom.XmlDocument): void; - getXmlDocument(format: Windows.Web.Syndication.SyndicationFormat): Windows.Data.Xml.Dom.XmlDocument; - } - export interface ISyndicationItemFactory { - createSyndicationItem(title: string, content: Windows.Web.Syndication.SyndicationContent, uri: Windows.Foundation.Uri): Windows.Web.Syndication.SyndicationItem; - } - export interface ISyndicationFeed extends Windows.Web.Syndication.ISyndicationNode { - authors: Windows.Foundation.Collections.IVector; - categories: Windows.Foundation.Collections.IVector; - contributors: Windows.Foundation.Collections.IVector; - firstUri: Windows.Foundation.Uri; - generator: Windows.Web.Syndication.SyndicationGenerator; - iconUri: Windows.Foundation.Uri; - id: string; - imageUri: Windows.Foundation.Uri; - items: Windows.Foundation.Collections.IVector; - lastUpdatedTime: Date; - lastUri: Windows.Foundation.Uri; - links: Windows.Foundation.Collections.IVector; - nextUri: Windows.Foundation.Uri; - previousUri: Windows.Foundation.Uri; - rights: Windows.Web.Syndication.ISyndicationText; - sourceFormat: Windows.Web.Syndication.SyndicationFormat; - subtitle: Windows.Web.Syndication.ISyndicationText; - title: Windows.Web.Syndication.ISyndicationText; - load(feed: string): void; - loadFromXml(feedDocument: Windows.Data.Xml.Dom.XmlDocument): void; - } - export interface ISyndicationFeedFactory { - createSyndicationFeed(title: string, subtitle: string, uri: Windows.Foundation.Uri): Windows.Web.Syndication.SyndicationFeed; - } - export interface ISyndicationClient { - bypassCacheOnRetrieve: boolean; - maxResponseBufferSize: number; - proxyCredential: Windows.Security.Credentials.PasswordCredential; - serverCredential: Windows.Security.Credentials.PasswordCredential; - timeout: number; - setRequestHeader(name: string, value: string): void; - retrieveFeedAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperationWithProgress; - } - export class SyndicationClient implements Windows.Web.Syndication.ISyndicationClient { - constructor(serverCredential: Windows.Security.Credentials.PasswordCredential); - constructor(); - bypassCacheOnRetrieve: boolean; - maxResponseBufferSize: number; - proxyCredential: Windows.Security.Credentials.PasswordCredential; - serverCredential: Windows.Security.Credentials.PasswordCredential; - timeout: number; - setRequestHeader(name: string, value: string): void; - retrieveFeedAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperationWithProgress; - } - export interface ISyndicationClientFactory { - createSyndicationClient(serverCredential: Windows.Security.Credentials.PasswordCredential): Windows.Web.Syndication.SyndicationClient; - } - export interface ISyndicationErrorStatics { - getStatus(hresult: number): Windows.Web.Syndication.SyndicationErrorStatus; - } - export class SyndicationError { - static getStatus(hresult: number): Windows.Web.Syndication.SyndicationErrorStatus; - } - } - } -} -declare module Windows { - export module Web { - export module AtomPub { - export interface IResourceCollection extends Windows.Web.Syndication.ISyndicationNode { - accepts: Windows.Foundation.Collections.IVectorView; - categories: Windows.Foundation.Collections.IVectorView; - title: Windows.Web.Syndication.ISyndicationText; - uri: Windows.Foundation.Uri; - } - export class ResourceCollection implements Windows.Web.AtomPub.IResourceCollection, Windows.Web.Syndication.ISyndicationNode { - accepts: Windows.Foundation.Collections.IVectorView; - categories: Windows.Foundation.Collections.IVectorView; - title: Windows.Web.Syndication.ISyndicationText; - uri: Windows.Foundation.Uri; - attributeExtensions: Windows.Foundation.Collections.IVector; - baseUri: Windows.Foundation.Uri; - elementExtensions: Windows.Foundation.Collections.IVector; - language: string; - nodeName: string; - nodeNamespace: string; - nodeValue: string; - getXmlDocument(format: Windows.Web.Syndication.SyndicationFormat): Windows.Data.Xml.Dom.XmlDocument; - } - export interface IWorkspace extends Windows.Web.Syndication.ISyndicationNode { - collections: Windows.Foundation.Collections.IVectorView; - title: Windows.Web.Syndication.ISyndicationText; - } - export class Workspace implements Windows.Web.AtomPub.IWorkspace, Windows.Web.Syndication.ISyndicationNode { - collections: Windows.Foundation.Collections.IVectorView; - title: Windows.Web.Syndication.ISyndicationText; - attributeExtensions: Windows.Foundation.Collections.IVector; - baseUri: Windows.Foundation.Uri; - elementExtensions: Windows.Foundation.Collections.IVector; - language: string; - nodeName: string; - nodeNamespace: string; - nodeValue: string; - getXmlDocument(format: Windows.Web.Syndication.SyndicationFormat): Windows.Data.Xml.Dom.XmlDocument; - } - export interface IServiceDocument extends Windows.Web.Syndication.ISyndicationNode { - workspaces: Windows.Foundation.Collections.IVectorView; - } - export class ServiceDocument implements Windows.Web.AtomPub.IServiceDocument, Windows.Web.Syndication.ISyndicationNode { - workspaces: Windows.Foundation.Collections.IVectorView; - attributeExtensions: Windows.Foundation.Collections.IVector; - baseUri: Windows.Foundation.Uri; - elementExtensions: Windows.Foundation.Collections.IVector; - language: string; - nodeName: string; - nodeNamespace: string; - nodeValue: string; - getXmlDocument(format: Windows.Web.Syndication.SyndicationFormat): Windows.Data.Xml.Dom.XmlDocument; - } - export interface IAtomPubClient extends Windows.Web.Syndication.ISyndicationClient { - retrieveServiceDocumentAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperationWithProgress; - retrieveMediaResourceAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperationWithProgress; - retrieveResourceAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperationWithProgress; - createResourceAsync(uri: Windows.Foundation.Uri, description: string, item: Windows.Web.Syndication.SyndicationItem): Windows.Foundation.IAsyncOperationWithProgress; - createMediaResourceAsync(uri: Windows.Foundation.Uri, mediaType: string, description: string, mediaStream: Windows.Storage.Streams.IInputStream): Windows.Foundation.IAsyncOperationWithProgress; - updateMediaResourceAsync(uri: Windows.Foundation.Uri, mediaType: string, mediaStream: Windows.Storage.Streams.IInputStream): Windows.Foundation.IAsyncActionWithProgress; - updateResourceAsync(uri: Windows.Foundation.Uri, item: Windows.Web.Syndication.SyndicationItem): Windows.Foundation.IAsyncActionWithProgress; - updateResourceItemAsync(item: Windows.Web.Syndication.SyndicationItem): Windows.Foundation.IAsyncActionWithProgress; - deleteResourceAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncActionWithProgress; - deleteResourceItemAsync(item: Windows.Web.Syndication.SyndicationItem): Windows.Foundation.IAsyncActionWithProgress; - cancelAsyncOperations(): void; - } - export class AtomPubClient implements Windows.Web.AtomPub.IAtomPubClient, Windows.Web.Syndication.ISyndicationClient { - constructor(serverCredential: Windows.Security.Credentials.PasswordCredential); - constructor(); - bypassCacheOnRetrieve: boolean; - maxResponseBufferSize: number; - proxyCredential: Windows.Security.Credentials.PasswordCredential; - serverCredential: Windows.Security.Credentials.PasswordCredential; - timeout: number; - retrieveServiceDocumentAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperationWithProgress; - retrieveMediaResourceAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperationWithProgress; - retrieveResourceAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperationWithProgress; - createResourceAsync(uri: Windows.Foundation.Uri, description: string, item: Windows.Web.Syndication.SyndicationItem): Windows.Foundation.IAsyncOperationWithProgress; - createMediaResourceAsync(uri: Windows.Foundation.Uri, mediaType: string, description: string, mediaStream: Windows.Storage.Streams.IInputStream): Windows.Foundation.IAsyncOperationWithProgress; - updateMediaResourceAsync(uri: Windows.Foundation.Uri, mediaType: string, mediaStream: Windows.Storage.Streams.IInputStream): Windows.Foundation.IAsyncActionWithProgress; - updateResourceAsync(uri: Windows.Foundation.Uri, item: Windows.Web.Syndication.SyndicationItem): Windows.Foundation.IAsyncActionWithProgress; - updateResourceItemAsync(item: Windows.Web.Syndication.SyndicationItem): Windows.Foundation.IAsyncActionWithProgress; - deleteResourceAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncActionWithProgress; - deleteResourceItemAsync(item: Windows.Web.Syndication.SyndicationItem): Windows.Foundation.IAsyncActionWithProgress; - cancelAsyncOperations(): void; - setRequestHeader(name: string, value: string): void; - retrieveFeedAsync(uri: Windows.Foundation.Uri): Windows.Foundation.IAsyncOperationWithProgress; - } - export interface IAtomPubClientFactory { - createAtomPubClientWithCredentials(serverCredential: Windows.Security.Credentials.PasswordCredential): Windows.Web.AtomPub.AtomPubClient; - } - } - } -} -declare module Windows.Foundation { - export interface IPromise { - then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done?(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; - } -} diff --git a/win8.1/encyclopedia/Encyclopedia/js/win.ts b/win8.1/encyclopedia/Encyclopedia/js/win.ts deleted file mode 100644 index 93c3cf2..0000000 --- a/win8.1/encyclopedia/Encyclopedia/js/win.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -/// - -declare var msSetImmediate: (expression: any) => void; \ No newline at end of file diff --git a/win8.1/encyclopedia/Encyclopedia/package.appxmanifest b/win8.1/encyclopedia/Encyclopedia/package.appxmanifest deleted file mode 100644 index 1b96e2d..0000000 --- a/win8.1/encyclopedia/Encyclopedia/package.appxmanifest +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Encyclopedia - Encyclopedia - TS - images\ep-storelogo.png - - - 6.3.0 - 6.3.0 - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 0f2d72365273b8bffc4290782dd679a41b813714 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 26 Feb 2016 13:58:27 -0800 Subject: [PATCH 05/63] Fix curly braces --- amd/greeter.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/amd/greeter.ts b/amd/greeter.ts index 0dc04ca..02fba4e 100644 --- a/amd/greeter.ts +++ b/amd/greeter.ts @@ -1,11 +1,9 @@ -export class Greeter -{ +export class Greeter { element: HTMLElement; span: HTMLElement; timerToken: number; - constructor (element: HTMLElement) - { + constructor (element: HTMLElement) { this.element = element; this.element.innerHTML += "The time is: "; this.span = document.createElement('span'); @@ -13,13 +11,11 @@ export class Greeter this.span.innerHTML = new Date().toUTCString(); } - start() - { + start() { this.timerToken = setInterval(() => this.span.innerHTML = new Date().toUTCString(), 500); } - stop() - { + stop() { clearInterval(this.timerToken); } } From ef2b1021aa23d7f45c902d59c02ea6030ed7da21 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Sun, 28 Feb 2016 18:48:28 -0800 Subject: [PATCH 06/63] copy es6-babel-react-flux-karma to react-with-type-safe-flux --- react-with-type-safe-flux/.gitignore | 201 ++++++++++++++++++ react-with-type-safe-flux/LICENSE | 22 ++ react-with-type-safe-flux/README.md | 47 ++++ react-with-type-safe-flux/gulp/.eslintrc | 73 +++++++ react-with-type-safe-flux/gulp/clean.js | 29 +++ react-with-type-safe-flux/gulp/inject.js | 55 +++++ react-with-type-safe-flux/gulp/staticFiles.js | 31 +++ react-with-type-safe-flux/gulp/tests.js | 26 +++ react-with-type-safe-flux/gulp/webpack.js | 91 ++++++++ react-with-type-safe-flux/gulpFile.js | 66 ++++++ react-with-type-safe-flux/karma.conf.js | 68 ++++++ react-with-type-safe-flux/package.json | 72 +++++++ .../src/actions/GreetingActions.ts | 23 ++ .../src/components/App.tsx | 44 ++++ .../src/components/Greeting.tsx | 36 ++++ .../src/components/WhoToGreet.tsx | 52 +++++ .../action-types/GreetingActionTypes.ts | 7 + .../src/dispatcher/AppDispatcher.ts | 5 + react-with-type-safe-flux/src/index.html | 19 ++ react-with-type-safe-flux/src/main.tsx | 6 + .../src/stores/FluxStore.ts | 62 ++++++ .../src/stores/GreetingStore.ts | 38 ++++ react-with-type-safe-flux/src/tsconfig.json | 38 ++++ .../src/types/GreetingState.ts | 6 + .../test/components/App.tests.tsx | 31 +++ .../test/components/Greeting.tests.tsx | 44 ++++ .../test/components/WhoToGreet.tests.tsx | 67 ++++++ .../test/import-babel-polyfill.js | 1 + .../test/stores/GreetingStore.tests.ts | 56 +++++ react-with-type-safe-flux/test/tsconfig.json | 34 +++ react-with-type-safe-flux/tsd.json | 27 +++ react-with-type-safe-flux/webpack.config.js | 42 ++++ 32 files changed, 1419 insertions(+) create mode 100644 react-with-type-safe-flux/.gitignore create mode 100644 react-with-type-safe-flux/LICENSE create mode 100644 react-with-type-safe-flux/README.md create mode 100644 react-with-type-safe-flux/gulp/.eslintrc create mode 100644 react-with-type-safe-flux/gulp/clean.js create mode 100644 react-with-type-safe-flux/gulp/inject.js create mode 100644 react-with-type-safe-flux/gulp/staticFiles.js create mode 100644 react-with-type-safe-flux/gulp/tests.js create mode 100644 react-with-type-safe-flux/gulp/webpack.js create mode 100644 react-with-type-safe-flux/gulpFile.js create mode 100644 react-with-type-safe-flux/karma.conf.js create mode 100644 react-with-type-safe-flux/package.json create mode 100644 react-with-type-safe-flux/src/actions/GreetingActions.ts create mode 100644 react-with-type-safe-flux/src/components/App.tsx create mode 100644 react-with-type-safe-flux/src/components/Greeting.tsx create mode 100644 react-with-type-safe-flux/src/components/WhoToGreet.tsx create mode 100644 react-with-type-safe-flux/src/constants/action-types/GreetingActionTypes.ts create mode 100644 react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts create mode 100644 react-with-type-safe-flux/src/index.html create mode 100644 react-with-type-safe-flux/src/main.tsx create mode 100644 react-with-type-safe-flux/src/stores/FluxStore.ts create mode 100644 react-with-type-safe-flux/src/stores/GreetingStore.ts create mode 100644 react-with-type-safe-flux/src/tsconfig.json create mode 100644 react-with-type-safe-flux/src/types/GreetingState.ts create mode 100644 react-with-type-safe-flux/test/components/App.tests.tsx create mode 100644 react-with-type-safe-flux/test/components/Greeting.tests.tsx create mode 100644 react-with-type-safe-flux/test/components/WhoToGreet.tests.tsx create mode 100644 react-with-type-safe-flux/test/import-babel-polyfill.js create mode 100644 react-with-type-safe-flux/test/stores/GreetingStore.tests.ts create mode 100644 react-with-type-safe-flux/test/tsconfig.json create mode 100644 react-with-type-safe-flux/tsd.json create mode 100644 react-with-type-safe-flux/webpack.config.js diff --git a/react-with-type-safe-flux/.gitignore b/react-with-type-safe-flux/.gitignore new file mode 100644 index 0000000..a983022 --- /dev/null +++ b/react-with-type-safe-flux/.gitignore @@ -0,0 +1,201 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ +dist/ + +# Visual Studo 2015 cache/options directory +.vs/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# JUnit test results +test-results + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +*.[Cc]ache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +bower_components/ +typings/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt diff --git a/react-with-type-safe-flux/LICENSE b/react-with-type-safe-flux/LICENSE new file mode 100644 index 0000000..12a65bc --- /dev/null +++ b/react-with-type-safe-flux/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 John Reilly + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/react-with-type-safe-flux/README.md b/react-with-type-safe-flux/README.md new file mode 100644 index 0000000..8c18bca --- /dev/null +++ b/react-with-type-safe-flux/README.md @@ -0,0 +1,47 @@ +# ES6 + TypeScript + Babel + React + Karma: The Secret Recipe + +## Getting started + +You'll need [node / npm](https://nodejs.org/) and [tsd](http://definitelytyped.org/tsd/) installed globally. To get up and running just enter: + +``` +npm install +tsd install +npm run serve +``` + +This will: + +1. Download the npm packages you need +2. Download the typings from DefinitelyTyped that you need. +3. Compile the code and serve it up at [http://localhost:8080](http://localhost:8080) + +Now you need dev tools. There's a world of choice out there; there's [Atom](https://atom.io/), there's [VS Code](https://www.visualstudio.com/en-us/products/code-vs.aspx), there's [Sublime](http://www.sublimetext.com/). There's even something called [Visual Studio](http://www.visualstudio.com). It's all your choice really. + +For myself I've been using Atom combined with the mighty [atom-typescript package](https://atom.io/packages/atom-typescript). I advise you to give it a go. You won't look back. + +## I want to have an ASP.Net project and use Visual Studio + IIS Express to serve this instead + +If you drop this code into an empty Visual Studio ASP.Net project should should be good to go. You'll need this section in your `web.config` to ensure Visual Studio serves from the `dist` directory: + +``` + + + + + + + + + + + + +``` + +And rather than running `npm run serve` you'll want to use `npm run watch`. (This builds / watches your code / runs tests etc but does **not** spin up a web server.) + +Finally you'll want to set the following TypeScript options for your project + +- ECMAScript Version: ECMAScript 6 +- JSX compilation in TSX files: Preserve diff --git a/react-with-type-safe-flux/gulp/.eslintrc b/react-with-type-safe-flux/gulp/.eslintrc new file mode 100644 index 0000000..e91bbce --- /dev/null +++ b/react-with-type-safe-flux/gulp/.eslintrc @@ -0,0 +1,73 @@ +{ + "root": true, + "env": { + "commonjs": true, + }, + "rules": { + "camelcase": 2, + "comma-spacing": 1, + "consistent-return": 2, + "curly": [ 2, "all" ], + "dot-notation": [ + 2, + { "allowKeywords": true } + ], + "eol-last": 2, + "eqeqeq": 2, + "keyword-spacing": 2, + "new-cap": 2, + "new-parens": 2, + "no-alert": 2, + "no-array-constructor": 2, + "no-caller": 2, + "no-catch-shadow": 2, + "no-eval": 2, + "no-extend-native": 2, + "no-extra-bind": 2, + "no-extra-parens": [ 2, "functions" ], + "no-implied-eval": 2, + "no-iterator": 2, + "no-labels": 2, + "no-label-var": 2, + "no-lone-blocks": 2, + "no-loop-func": 2, + "no-multi-str": 2, + "no-native-reassign": 2, + "no-new": 2, + "no-new-func": 2, + "no-new-object": 2, + "no-new-wrappers": 2, + "no-octal-escape": 2, + "no-proto": 2, + "no-return-assign": 2, + "no-script-url": 2, + "no-sequences": 2, + "no-shadow": 2, + "no-shadow-restricted-names": 2, + "no-spaced-func": 2, + "no-trailing-spaces": 1, + "no-undef-init": 2, + "no-unused-expressions": 2, + "no-use-before-define": [ 2, "nofunc" ], + "no-with": 2, + "quotes": [ 1, "single" ], + "semi": 2, + "semi-spacing": [ + 2, + { + "before": false, + "after": true + } + ], + "space-infix-ops": 2, + "space-unary-ops": [ + 2, + { + "words": true, + "nonwords": false + } + ], + "strict": [ 2, "global" ], + "yoda": [ 2, "never" ] + } +} diff --git a/react-with-type-safe-flux/gulp/clean.js b/react-with-type-safe-flux/gulp/clean.js new file mode 100644 index 0000000..c51b4e4 --- /dev/null +++ b/react-with-type-safe-flux/gulp/clean.js @@ -0,0 +1,29 @@ +'use strict'; + +var del = require('del'); +var gutil = require('gulp-util'); +var fs = require('fs'); + +function run(done) { + fs.stat('./dist', function(err){ + if (err) { + // Never existed + done(); + } + else { + del(['./dist'], { force: true }) + .then(function(paths) { + gutil.log('Deleted files/folders:\n', paths.join('\n')); + done(); + }) + .catch(function(error) { + gutil.log('Problem deleting:\n', error); + done(); + }); + } + }); +} + +module.exports = { + run: function(done) { return run(done); } +}; diff --git a/react-with-type-safe-flux/gulp/inject.js b/react-with-type-safe-flux/gulp/inject.js new file mode 100644 index 0000000..e4133e5 --- /dev/null +++ b/react-with-type-safe-flux/gulp/inject.js @@ -0,0 +1,55 @@ +'use strict'; + +var gulp = require('gulp'); +var inject = require('gulp-inject'); +var glob = require('glob'); + +function injectIndex(options) { + function run() { + var target = gulp.src('./src/index.html'); + var sources = gulp.src([ + //'./dist/styles/main*.css', + './dist/scripts/vendor*.js', + './dist/scripts/main*.js' + ], { read: false }); + + return target + .pipe(inject(sources, { ignorePath: '/dist/', addRootSlash: false, removeTags: true })) + .pipe(gulp.dest('./dist')); + } + + var jsCssGlob = 'dist/**/*.{js,css}'; + + function checkForInitialFilesThenRun() { + glob(jsCssGlob, function (er, files) { + var filesWeNeed = ['dist/scripts/main', 'dist/scripts/vendor'/*, 'dist/styles/main'*/]; + + function fileIsPresent(fileWeNeed) { + return files.some(function(file) { + return file.indexOf(fileWeNeed) !== -1; + }); + } + + if (filesWeNeed.every(fileIsPresent)) { + run('initial build'); + } else { + checkForInitialFilesThenRun(); + } + }); + } + + checkForInitialFilesThenRun(); + + if (options.shouldWatch) { + gulp.watch(jsCssGlob, function(evt) { + if (evt.path && evt.type === 'changed') { + run(evt.path); + } + }); + } +} + +module.exports = { + build: function() { return injectIndex({ shouldWatch: false }); }, + watch: function() { return injectIndex({ shouldWatch: true }); } +}; diff --git a/react-with-type-safe-flux/gulp/staticFiles.js b/react-with-type-safe-flux/gulp/staticFiles.js new file mode 100644 index 0000000..20327f2 --- /dev/null +++ b/react-with-type-safe-flux/gulp/staticFiles.js @@ -0,0 +1,31 @@ +'use strict'; + +var gulp = require('gulp'); +var cache = require('gulp-cached'); + +var targets = [ + { description: 'INDEX', src: './src/index.html', dest: './dist' } +]; + +function copy(options) { + function run(target) { + gulp.src(target.src) + .pipe(cache(target.description)) + .pipe(gulp.dest(target.dest)); + } + + function watch(target) { + gulp.watch(target.src, function() { run(target); }); + } + + targets.forEach(run); + + if (options.shouldWatch) { + targets.forEach(watch); + } +} + +module.exports = { + build: function() { return copy({ shouldWatch: false }); }, + watch: function() { return copy({ shouldWatch: true }); } +}; diff --git a/react-with-type-safe-flux/gulp/tests.js b/react-with-type-safe-flux/gulp/tests.js new file mode 100644 index 0000000..4d6ba04 --- /dev/null +++ b/react-with-type-safe-flux/gulp/tests.js @@ -0,0 +1,26 @@ +'use strict'; + +var Server = require('karma').Server; +var path = require('path'); +var gutil = require('gulp-util'); + +module.exports = { + watch: function() { + // Documentation: https://karma-runner.github.io/0.13/dev/public-api.html + var karmaConfig = { + configFile: path.join(__dirname, '../karma.conf.js'), + singleRun: false, + + // Fancy runner + plugins: ['karma-webpack', 'karma-jasmine', 'karma-mocha-reporter', /*'karma-junit-reporter', 'karma-coverage', */'karma-sourcemap-loader', 'karma-phantomjs-launcher'], + reporters: ['mocha'] + }; + + new Server(karmaConfig, karmaCompleted).start(); + + function karmaCompleted(exitCode) { + gutil.log('Karma has exited with:', exitCode); + process.exit(exitCode); + } + } +}; diff --git a/react-with-type-safe-flux/gulp/webpack.js b/react-with-type-safe-flux/gulp/webpack.js new file mode 100644 index 0000000..37c4ded --- /dev/null +++ b/react-with-type-safe-flux/gulp/webpack.js @@ -0,0 +1,91 @@ +'use strict'; + +var gulp = require('gulp'); +var gutil = require('gulp-util'); +var webpack = require('webpack'); +var WebpackNotifierPlugin = require('webpack-notifier'); +var webpackConfig = require('../webpack.config.js'); + +function buildProduction(done) { + // modify some webpack config options + var myProdConfig = Object.create(webpackConfig); + myProdConfig.output.filename = '[name].[hash].js'; + + myProdConfig.plugins = myProdConfig.plugins.concat( + new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.[hash].js' }), + new webpack.optimize.DedupePlugin(), + new webpack.optimize.UglifyJsPlugin() + ); + + // run webpack + webpack(myProdConfig, function(err, stats) { + if(err) { throw new gutil.PluginError('webpack:build', err); } + gutil.log('[webpack:build]', stats.toString({ + colors: true + })); + + if (done) { done(); } + }); +} + +function createDevCompiler() { + // modify some webpack config options + var myDevConfig = Object.create(webpackConfig); + myDevConfig.devtool = 'inline-source-map'; + myDevConfig.debug = true; + + myDevConfig.plugins = myDevConfig.plugins.concat( + new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.js' }), + new WebpackNotifierPlugin({ title: 'Webpack build', excludeWarnings: true }) + ); + + // create a single instance of the compiler to allow caching + return webpack(myDevConfig); +} + +function buildDevelopment(done, devCompiler) { + // run webpack + devCompiler.run(function(err, stats) { + if(err) { throw new gutil.PluginError('webpack:build-dev', err); } + gutil.log('[webpack:build-dev]', stats.toString({ + chunks: false, + colors: true + })); + + if (done) { done(); } + }); +} + + +function bundle(options) { + var devCompiler; + + function build(done) { + if (options.shouldWatch) { + buildDevelopment(done, devCompiler); + } else { + buildProduction(done); + } + } + + if (options.shouldWatch) { + devCompiler = createDevCompiler(); + + gulp.watch('src/**/*', function() { build(); }); + } + + return new Promise(function(resolve, reject) { + build(function (err) { + if (err) { + reject(err); + } else { + resolve('webpack built'); + } + }); + }); +} + +module.exports = { + build: function() { return bundle({ shouldWatch: false }); }, + watch: function() { return bundle({ shouldWatch: true }); } +}; diff --git a/react-with-type-safe-flux/gulpFile.js b/react-with-type-safe-flux/gulpFile.js new file mode 100644 index 0000000..b7b3abe --- /dev/null +++ b/react-with-type-safe-flux/gulpFile.js @@ -0,0 +1,66 @@ +/* eslint-disable no-var, strict, prefer-arrow-callback */ +'use strict'; + +var gulp = require('gulp'); +var gutil = require('gulp-util'); +var eslint = require('gulp-eslint'); +var webpack = require('./gulp/webpack'); +var staticFiles = require('./gulp/staticFiles'); +var tests = require('./gulp/tests'); +var clean = require('./gulp/clean'); +var inject = require('./gulp/inject'); + +var lintSrcs = ['./gulp/**/*.js']; + +gulp.task('delete-dist', function (done) { + clean.run(done); +}); + +gulp.task('build-process.env.NODE_ENV', function () { + process.env.NODE_ENV = 'production'; +}); + +gulp.task('build-js', ['delete-dist', 'build-process.env.NODE_ENV'], function(done) { + webpack.build().then(function() { done(); }); +}); + +gulp.task('build-other', ['delete-dist', 'build-process.env.NODE_ENV'], function() { + staticFiles.build(); +}); + +gulp.task('build', ['build-js', 'build-other', 'lint'], function () { + inject.build(); +}); + +gulp.task('lint', function () { + return gulp.src(lintSrcs) + .pipe(eslint()) + .pipe(eslint.format()); +}); + +gulp.task('watch', ['delete-dist'], function(done) { + process.env.NODE_ENV = 'development'; + Promise.all([ + webpack.watch()//, + //less.watch() + ]).then(function() { + gutil.log('Now that initial assets (js and css) are generated inject will start...'); + inject.watch(); + done(); + }).catch(function(error) { + gutil.log('Problem generating initial assets (js and css)', error); + }); + + gulp.watch(lintSrcs, ['lint']); + staticFiles.watch(); + tests.watch(); +}); + +gulp.task('watch-and-serve', ['watch'], function() { + // local as not required for build + var express = require('express') + var app = express() + + app.use(express.static('dist', {'index': 'index.html'})) + app.listen(8080); +}); diff --git a/react-with-type-safe-flux/karma.conf.js b/react-with-type-safe-flux/karma.conf.js new file mode 100644 index 0000000..10ffba7 --- /dev/null +++ b/react-with-type-safe-flux/karma.conf.js @@ -0,0 +1,68 @@ +/* eslint-disable no-var, strict */ +'use strict'; + +var webpackConfig = require('./webpack.config.js'); + +module.exports = function(config) { + // Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html + config.set({ + browsers: [ 'PhantomJS' ], + + files: [ + 'test/import-babel-polyfill.js', // This ensures we have the es6 shims in place from babel + 'test/**/*.tests.ts', + 'test/**/*.tests.tsx' + ], + + port: 9876, + + frameworks: [ 'jasmine' ], + + logLevel: config.LOG_INFO, //config.LOG_DEBUG + + preprocessors: { + 'test/import-babel-polyfill.js': [ 'webpack', 'sourcemap' ], + 'src/**/*.{ts,tsx}': [ 'webpack', 'sourcemap' ], + 'test/**/*.tests.{ts,tsx}': [ 'webpack', 'sourcemap' ] + }, + + webpack: { + devtool: 'eval-source-map', //'inline-source-map', + debug: true, + module: webpackConfig.module, + resolve: webpackConfig.resolve + }, + + webpackMiddleware: { + quiet: true, + stats: { + colors: true + } + }, + + // reporter options + mochaReporter: { + colors: { + success: 'bgGreen', + info: 'cyan', + warning: 'bgBlue', + error: 'bgRed' + } + }, + + // the default configuration + junitReporter: { + outputDir: 'test-results', // results will be saved as $outputDir/$browserName.xml + outputFile: undefined, // if included, results will be saved as $outputDir/$browserName/$outputFile + suite: '' + }, + + coverageReporter: { + reporters:[ + //{type: 'html', dir:'coverage/'}, // https://github.com/karma-runner/karma-coverage/issues/123 + {type: 'text'}, + {type: 'text-summary'} + ], + } + }); +}; diff --git a/react-with-type-safe-flux/package.json b/react-with-type-safe-flux/package.json new file mode 100644 index 0000000..04d8f90 --- /dev/null +++ b/react-with-type-safe-flux/package.json @@ -0,0 +1,72 @@ +{ + "name": "es6-babel-react-flux-karma", + "version": "1.0.0", + "description": "ES6 + TypeScript + Babel + React + Karma: The Secret Recipe", + "main": "index.js", + "scripts": { + "test": "karma start --reporters mocha,junit --single-run --browsers PhantomJS", + "serve": "gulp watch-and-serve", + "watch": "gulp watch", + "build": "gulp build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/microsoft/typescriptsamples.git" + }, + "keywords": [ + "React", + "Flux", + "ES6", + "typescript" + ], + "author": "John Reilly", + "license": "MIT", + "bugs": { + "url": "https://github.com/microsoft/typescriptsamples/issues" + }, + "homepage": "https://github.com/Microsoft/TypeScriptSamples/tree/master/es6-babel-react-flux-karma#readme", + "devDependencies": { + "babel": "^6.0.0", + "babel-core": "^6.0.0", + "babel-loader": "^6.0.0", + "babel-polyfill": "^6.0.0", + "babel-preset-es2015": "^6.0.0", + "babel-preset-react": "^6.0.0", + "del": "^2.0.2", + "eslint": "^2.0.0", + "express": "^4.13.3", + "flux": "^2.0.3", + "glob": "^7.0.0", + "gulp": "^3.9.0", + "gulp-autoprefixer": "^3.1.0", + "gulp-cached": "^1.1.0", + "gulp-cssmin": "^0.1.7", + "gulp-eslint": "^2.0.0", + "gulp-if": "^2.0.0", + "gulp-inject": "^3.0.0", + "gulp-notify": "^2.2.0", + "gulp-sourcemaps": "^1.5.2", + "gulp-streamify": "1.0.2", + "gulp-uglify": "^1.2.0", + "gulp-util": "^3.0.6", + "jasmine-core": "^2.3.4", + "karma": "^0.13.10", + "karma-coverage": "^0.5.2", + "karma-jasmine": "^0.3.6", + "karma-junit-reporter": "^0.3.7", + "karma-mocha-reporter": "^1.1.1", + "karma-phantomjs-launcher": "^1.0.0", + "karma-phantomjs-shim": "^1.1.1", + "karma-sourcemap-loader": "^0.3.6", + "karma-webpack": "^1.7.0", + "phantomjs": "^2.1.3", + "phantomjs-prebuilt": "^2.1.4", + "react": "^0.14.3", + "react-addons-test-utils": "^0.14.3", + "react-dom": "^0.14.3", + "ts-loader": "^0.8.1", + "typescript": "^1.8.0", + "webpack": "^1.12.2", + "webpack-notifier": "^1.2.1" + } +} diff --git a/react-with-type-safe-flux/src/actions/GreetingActions.ts b/react-with-type-safe-flux/src/actions/GreetingActions.ts new file mode 100644 index 0000000..c451280 --- /dev/null +++ b/react-with-type-safe-flux/src/actions/GreetingActions.ts @@ -0,0 +1,23 @@ +import AppDispatcher from '../dispatcher/AppDispatcher'; +import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; + +export function addGreeting(newGreeting: string) { + AppDispatcher.dispatch({ + newGreeting, + type: GreetingActionTypes.ADD_GREETING + }); +} + +export function newGreetingChanged(newGreeting: string) { + AppDispatcher.dispatch({ + newGreeting, + type: GreetingActionTypes.NEW_GREETING_CHANGED + }); +} + +export function removeGreeting(greetingToRemove: string) { + AppDispatcher.dispatch({ + greetingToRemove, + type: GreetingActionTypes.REMOVE_GREETING + }); +} diff --git a/react-with-type-safe-flux/src/components/App.tsx b/react-with-type-safe-flux/src/components/App.tsx new file mode 100644 index 0000000..f6bceb6 --- /dev/null +++ b/react-with-type-safe-flux/src/components/App.tsx @@ -0,0 +1,44 @@ +import * as React from 'react'; +import GreetingStore from '../stores/GreetingStore'; +import * as GreetingActions from '../actions/GreetingActions'; +import GreetingState from '../types/GreetingState'; +import WhoToGreet from './WhoToGreet'; +import Greeting from './Greeting'; + +class App extends React.Component { + constructor(props) { + super(props); + this.state = this._getStateFromStores(); + } + + componentWillMount() { + GreetingStore.addChangeListener(this._onChange); + } + + componentWillUnmount() { + GreetingStore.removeChangeListener(this._onChange); + } + + render() { + const { greetings, newGreeting } = this.state; + return ( +
+

Hello People!

+ + + + { greetings.map((g, index) => ) } +
+ ); + } + + _onChange = () => { + this.setState(this._getStateFromStores()); + } + + _getStateFromStores() { + return GreetingStore.getState(); + } +} + +export default App; diff --git a/react-with-type-safe-flux/src/components/Greeting.tsx b/react-with-type-safe-flux/src/components/Greeting.tsx new file mode 100644 index 0000000..213af66 --- /dev/null +++ b/react-with-type-safe-flux/src/components/Greeting.tsx @@ -0,0 +1,36 @@ +import * as React from 'react'; +import * as GreetingActions from '../actions/GreetingActions'; + +interface Props { + key: number; + targetOfGreeting: string; +} + +class Greeting extends React.Component { + constructor(props) { + super(props); + } + + static propTypes: React.ValidationMap = { + targetOfGreeting: React.PropTypes.string.isRequired + } + + render() { + return ( +

+ Hello { this.props.targetOfGreeting }! + + +

+ ); + } + + _onClick = (event) => { + GreetingActions.removeGreeting(this.props.targetOfGreeting); + } +} + +export default Greeting; diff --git a/react-with-type-safe-flux/src/components/WhoToGreet.tsx b/react-with-type-safe-flux/src/components/WhoToGreet.tsx new file mode 100644 index 0000000..5e3794f --- /dev/null +++ b/react-with-type-safe-flux/src/components/WhoToGreet.tsx @@ -0,0 +1,52 @@ +import * as React from 'react'; +import * as GreetingActions from '../actions/GreetingActions'; + +interface Props { + newGreeting: string; +} + +class WhoToGreet extends React.Component { + constructor(props) { + super(props); + } + + static propTypes: React.ValidationMap = { + newGreeting: React.PropTypes.string.isRequired + } + + render() { + return ( +
+
+ + +
+
+ ); + } + + get _preventSubmission() { + return !this.props.newGreeting; + } + + _handleNewGreetingChange = (event) => { + const { target: { value: newGreeting } } = event; + GreetingActions.newGreetingChanged(newGreeting); + } + + _onSubmit = (event) => { + event.preventDefault(); + + if (!this._preventSubmission) { + GreetingActions.addGreeting(this.props.newGreeting); + } + } +} + +export default WhoToGreet; diff --git a/react-with-type-safe-flux/src/constants/action-types/GreetingActionTypes.ts b/react-with-type-safe-flux/src/constants/action-types/GreetingActionTypes.ts new file mode 100644 index 0000000..ef9fda4 --- /dev/null +++ b/react-with-type-safe-flux/src/constants/action-types/GreetingActionTypes.ts @@ -0,0 +1,7 @@ +const GreetingActionTypes = { + ADD_GREETING: 'GreetingActionTypes.ADD_GREETING', + REMOVE_GREETING: 'GreetingActionTypes.REMOVE_GREETING', + NEW_GREETING_CHANGED: 'GreetingActionTypes.NEW_GREETING_CHANGED' +}; + +export default GreetingActionTypes; diff --git a/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts b/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts new file mode 100644 index 0000000..428b8a6 --- /dev/null +++ b/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts @@ -0,0 +1,5 @@ +import { Dispatcher } from 'flux'; + +const dispatcherInstance = new Dispatcher(); + +export default dispatcherInstance; diff --git a/react-with-type-safe-flux/src/index.html b/react-with-type-safe-flux/src/index.html new file mode 100644 index 0000000..c5c150d --- /dev/null +++ b/react-with-type-safe-flux/src/index.html @@ -0,0 +1,19 @@ + + + + + + + + ES6 + Babel + React + Flux + Karma: The Secret Recipe + + + + + + +
+ + + + diff --git a/react-with-type-safe-flux/src/main.tsx b/react-with-type-safe-flux/src/main.tsx new file mode 100644 index 0000000..1e14a73 --- /dev/null +++ b/react-with-type-safe-flux/src/main.tsx @@ -0,0 +1,6 @@ +import 'babel-polyfill'; +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import App from './components/App'; + +ReactDOM.render(, document.getElementById('content')); diff --git a/react-with-type-safe-flux/src/stores/FluxStore.ts b/react-with-type-safe-flux/src/stores/FluxStore.ts new file mode 100644 index 0000000..552aaf7 --- /dev/null +++ b/react-with-type-safe-flux/src/stores/FluxStore.ts @@ -0,0 +1,62 @@ +import { EventEmitter } from 'events'; + +const CHANGE_EVENT = 'change'; + +class FluxStore { + _changed: boolean; + _emitter: EventEmitter; + dispatchToken: string; + _dispatcher: Flux.Dispatcher; + _cleanStateFn: () => TState; + _state: TState; + + constructor(dispatcher, cleanStateFn) { + this._emitter = new EventEmitter(); + this._changed = false; + this._dispatcher = dispatcher; + this.dispatchToken = dispatcher.register(payload => { + this._invokeOnDispatch(payload); + }); + + this._cleanStateFn = cleanStateFn; + this._state = this._cleanStateFn(); + } + + /** + * Is idempotent per dispatched event + */ + emitChange() { + this._changed = true; + } + + hasChanged() { return this._changed; } + + addChangeListener(callback) { + this._emitter.on(CHANGE_EVENT, callback); + } + + removeChangeListener(callback) { + this._emitter.removeListener(CHANGE_EVENT, callback); + } + + _cleanState() { + this._changed = false; + this._state = this._cleanStateFn(); + } + + _invokeOnDispatch(payload) { + this._changed = false; + this._onDispatch(payload); + if (this._changed) { + this._emitter.emit(CHANGE_EVENT); + } + } + + _onDispatch(payload) { + if (process.env.NODE_ENV !== 'production') { + console.error(`${this.constructor.name} has not overridden FluxStore.__onDispatch(), which is required`); // eslint-disable-line no-console + } + } +} + +export default FluxStore; diff --git a/react-with-type-safe-flux/src/stores/GreetingStore.ts b/react-with-type-safe-flux/src/stores/GreetingStore.ts new file mode 100644 index 0000000..c80dbfc --- /dev/null +++ b/react-with-type-safe-flux/src/stores/GreetingStore.ts @@ -0,0 +1,38 @@ +import FluxStore from './FluxStore'; +import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; +import AppDispatcher from '../dispatcher/AppDispatcher'; +import GreetingState from '../types/GreetingState'; + +class GreeterStore extends FluxStore { + constructor(dispatcher) { + super(dispatcher, () => ({ + greetings: [], + newGreeting: '' + })); + } + + getState() { + return this._state + } + + _onDispatch(action) { + switch(action.type) { + case GreetingActionTypes.ADD_GREETING: + this._state.newGreeting = ''; + this._state.greetings = this._state.greetings.concat(action.newGreeting); + this.emitChange(); + break; + case GreetingActionTypes.REMOVE_GREETING: + this._state.greetings = this._state.greetings.filter(g => g !== action.greetingToRemove); + this.emitChange(); + break; + case GreetingActionTypes.NEW_GREETING_CHANGED: + this._state.newGreeting = action.newGreeting; + this.emitChange(); + break; + } + } +} + +const greeterStoreInstance = new GreeterStore(AppDispatcher); +export default greeterStoreInstance; diff --git a/react-with-type-safe-flux/src/tsconfig.json b/react-with-type-safe-flux/src/tsconfig.json new file mode 100644 index 0000000..dbffad0 --- /dev/null +++ b/react-with-type-safe-flux/src/tsconfig.json @@ -0,0 +1,38 @@ +{ + "compileOnSave": false, + "filesGlob": [ + "../typings/**/*.*.ts", + "!../typings/jasmine/jasmine.d.ts", + "!../typings/react/react-addons-test-utils.d.ts", + "**/*.{ts,tsx}" + ], + "compilerOptions": { + "jsx": "preserve", + "target": "es6", + "noImplicitAny": false, + "removeComments": false, + "preserveConstEnums": true, + "sourceMap": true + }, + "files": [ + "../typings/flux/flux.d.ts", + "../typings/node/node.d.ts", + "../typings/react/react-dom.d.ts", + "../typings/react/react.d.ts", + "../typings/tsd.d.ts", + "actions/GreetingActions.ts", + "components/App.tsx", + "components/Greeting.tsx", + "components/WhoToGreet.tsx", + "constants/action-types/GreetingActionTypes.ts", + "dispatcher/AppDispatcher.ts", + "main.tsx", + "stores/FluxStore.ts", + "stores/GreetingStore.ts", + "types/GreetingState.ts" + ], + "exclude": [], + "atom": { + "rewriteTsconfig": true + } +} diff --git a/react-with-type-safe-flux/src/types/GreetingState.ts b/react-with-type-safe-flux/src/types/GreetingState.ts new file mode 100644 index 0000000..656b201 --- /dev/null +++ b/react-with-type-safe-flux/src/types/GreetingState.ts @@ -0,0 +1,6 @@ +interface GreetingState { + greetings: string[]; + newGreeting: string; +} + +export default GreetingState; diff --git a/react-with-type-safe-flux/test/components/App.tests.tsx b/react-with-type-safe-flux/test/components/App.tests.tsx new file mode 100644 index 0000000..1530e64 --- /dev/null +++ b/react-with-type-safe-flux/test/components/App.tests.tsx @@ -0,0 +1,31 @@ +import * as React from 'react'; +import * as TestUtils from 'react-addons-test-utils'; +import App from '../../src/components/App'; +import WhoToGreet from '../../src/components/WhoToGreet'; +import Greeting from '../../src/components/Greeting'; +import GreetingStore from '../../src/stores/GreetingStore'; + +describe('App', () => { + it('renders expected HTML', () => { + const app = render({ greetings: ['James'], newGreeting: 'Benjamin' }); + expect(app).toEqual( +
+

Hello People!

+ + + + { [ + + ] } +
+ ); + }); + + function render(state) { + const shallowRenderer = TestUtils.createRenderer(); + spyOn(GreetingStore, 'getState').and.returnValue(state); + + shallowRenderer.render(); + return shallowRenderer.getRenderOutput(); + } +}); diff --git a/react-with-type-safe-flux/test/components/Greeting.tests.tsx b/react-with-type-safe-flux/test/components/Greeting.tests.tsx new file mode 100644 index 0000000..9ea44b4 --- /dev/null +++ b/react-with-type-safe-flux/test/components/Greeting.tests.tsx @@ -0,0 +1,44 @@ +import * as React from 'react'; +import * as TestUtils from 'react-addons-test-utils'; +import Greeting from '../../src/components/Greeting'; +import * as GreetingActions from '../../src/actions/GreetingActions'; + +describe('Greeting', () => { + let handleSelectionChangeSpy: jasmine.Spy; + beforeEach(() => { + handleSelectionChangeSpy = jasmine.createSpy('handleSelectionChange'); + }); + + it('given a targetOfGreeting of \'James\' it renders a p containing a greeting and a remove button', () => { + const targetOfGreeting = 'James'; + + const p = render({ targetOfGreeting }); + expect(p.type).toBe('p'); + expect(p.props.children[0]).toBe('Hello '); + expect(p.props.children[1]).toBe('James'); + expect(p.props.children[2]).toBe('!'); + + const [ , , , button ] = p.props.children; + + expect(button.type).toBe('button'); + expect(button.props.className).toBe('btn btn-default btn-danger'); + expect(button.props.children).toBe('Remove'); + }); + + it('button onClick triggers an removeGreeting action', () => { + const targetOfGreeting = 'Benjamin'; + const p = render({ targetOfGreeting }); + const [ , , , button ] = p.props.children; + spyOn(GreetingActions, 'removeGreeting'); + + button.props.onClick(); + + expect(GreetingActions.removeGreeting).toHaveBeenCalledWith(targetOfGreeting); + }); + + function render({ targetOfGreeting }) { + const shallowRenderer = TestUtils.createRenderer(); + shallowRenderer.render(); + return shallowRenderer.getRenderOutput(); + } +}); diff --git a/react-with-type-safe-flux/test/components/WhoToGreet.tests.tsx b/react-with-type-safe-flux/test/components/WhoToGreet.tests.tsx new file mode 100644 index 0000000..e514ec3 --- /dev/null +++ b/react-with-type-safe-flux/test/components/WhoToGreet.tests.tsx @@ -0,0 +1,67 @@ +import * as React from 'react'; +import * as TestUtils from 'react-addons-test-utils'; +import WhoToGreet from '../../src/components/WhoToGreet'; +import * as GreetingActions from '../../src/actions/GreetingActions'; + +describe('WhoToGreet', () => { + let handleSelectionChangeSpy: jasmine.Spy; + beforeEach(() => { + handleSelectionChangeSpy = jasmine.createSpy('handleSelectionChange'); + }); + + it('given a newGreeting then it renders a form containing an input containing that text and an add button', () => { + const newGreeting = 'James'; + + const form = render({ newGreeting }); + expect(form.type).toBe('form'); + expect(form.props.role).toBe('form'); + + const formGroup = form.props.children; + expect(formGroup.type).toBe('div'); + expect(formGroup.props.className).toBe('form-group'); + + const [ input, button ] = formGroup.props.children; + + expect(input.type).toBe('input'); + expect(input.props.type).toBe('text'); + expect(input.props.className).toBe('form-control'); + expect(input.props.placeholder).toBe('Who would you like to greet?'); + expect(input.props.value).toBe(newGreeting); + + expect(button.type).toBe('button'); + expect(button.props.type).toBe('submit'); + expect(button.props.className).toBe('btn btn-default btn-primary'); + expect(button.props.disabled).toBe(false); + expect(button.props.children).toBe('Add greeting'); + }); + + it('input onChange triggers a newGreetingChanged action', () => { + const newGreeting = 'Benjamin'; + const form = render({ newGreeting }); + const formGroup = form.props.children; + const [ input ] = formGroup.props.children; + spyOn(GreetingActions, 'newGreetingChanged'); + + input.props.onChange({ target: { value: newGreeting }}); + + expect(GreetingActions.newGreetingChanged).toHaveBeenCalledWith(newGreeting); + }); + + it('button onClick triggers an addGreeting action', () => { + const newGreeting = 'Benjamin'; + const form = render({ newGreeting }); + const formGroup = form.props.children; + const [ , button ] = formGroup.props.children; + spyOn(GreetingActions, 'addGreeting'); + + button.props.onClick({ preventDefault: () => {} }); + + expect(GreetingActions.addGreeting).toHaveBeenCalledWith(newGreeting); + }); + + function render({ newGreeting }) { + const shallowRenderer = TestUtils.createRenderer(); + shallowRenderer.render(); + return shallowRenderer.getRenderOutput(); + } +}); diff --git a/react-with-type-safe-flux/test/import-babel-polyfill.js b/react-with-type-safe-flux/test/import-babel-polyfill.js new file mode 100644 index 0000000..b012711 --- /dev/null +++ b/react-with-type-safe-flux/test/import-babel-polyfill.js @@ -0,0 +1 @@ +import 'babel-polyfill'; diff --git a/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts b/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts new file mode 100644 index 0000000..cb536b9 --- /dev/null +++ b/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts @@ -0,0 +1,56 @@ +import GreetingStore from '../../src/stores/GreetingStore'; +import GreetingActionTypes from '../../src/constants/action-types/GreetingActionTypes'; + +const registeredCallback = GreetingStore._onDispatch.bind(GreetingStore); + +describe('GreetingStore', () => { + beforeEach(() => { + GreetingStore._cleanState(); + }); + + it('given no actions, newGreeting should be an empty string and greetings should be an empty array', () => { + const { greetings, newGreeting } = GreetingStore.getState(); + + expect(greetings).toEqual([]); + expect(newGreeting).toBe(''); + }); + + it('given an ADD_GREETING action with a newGreeting of \'Benjamin\', the newGreeting should be an empty string and greetings should contain \'Benjamin\'', () => { + [{ + newGreeting: 'Benjamin', + type: GreetingActionTypes.ADD_GREETING, + }].forEach(registeredCallback); + + const { greetings, newGreeting } = GreetingStore.getState(); + + expect(greetings.find(g => g === 'Benjamin')).toBeTruthy(); + expect(newGreeting).toBe(''); + }); + + it('given an REMOVE_GREETING action with a greetingToRemove of \'Benjamin\', the state greetings should be an empty array', () => { + [{ + newGreeting: 'Benjamin', + type: GreetingActionTypes.ADD_GREETING, + }, { + greetingToRemove: 'Benjamin', + type: GreetingActionTypes.REMOVE_GREETING, + }].forEach(registeredCallback); + + const { greetings } = GreetingStore.getState(); + + expect(greetings.length).toBe(0); + expect(greetings.find(g => g === 'Benjamin')).toBeFalsy(); + }); + + it('given a NEW_GREETING_CHANGED action with a newGreeting of \'Benjamin\', the state newGreeting should be \'Benjamin\'', () => { + [{ + newGreeting: 'Benjamin', + type: GreetingActionTypes.NEW_GREETING_CHANGED, + }].forEach(registeredCallback); + + const { newGreeting } = GreetingStore.getState(); + + expect(newGreeting).toEqual('Benjamin'); + }); + +}); diff --git a/react-with-type-safe-flux/test/tsconfig.json b/react-with-type-safe-flux/test/tsconfig.json new file mode 100644 index 0000000..368d9d5 --- /dev/null +++ b/react-with-type-safe-flux/test/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compileOnSave": false, + "filesGlob": [ + "**/*.{ts,tsx}", + "../typings/**/*.*.ts" + ], + "compilerOptions": { + "jsx": "preserve", + "target": "es6", + "module": "commonjs", + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "removeComments": false, + "preserveConstEnums": true, + "sourceMap": true + }, + "files": [ + "components/App.tests.tsx", + "components/Greeting.tests.tsx", + "components/WhoToGreet.tests.tsx", + "stores/GreetingStore.tests.ts", + "../typings/flux/flux.d.ts", + "../typings/jasmine/jasmine.d.ts", + "../typings/node/node.d.ts", + "../typings/react/react-addons-test-utils.d.ts", + "../typings/react/react-dom.d.ts", + "../typings/react/react.d.ts", + "../typings/tsd.d.ts" + ], + "exclude": [], + "atom": { + "rewriteTsconfig": true + } +} diff --git a/react-with-type-safe-flux/tsd.json b/react-with-type-safe-flux/tsd.json new file mode 100644 index 0000000..2716a22 --- /dev/null +++ b/react-with-type-safe-flux/tsd.json @@ -0,0 +1,27 @@ +{ + "version": "v4", + "repo": "borisyankov/DefinitelyTyped", + "ref": "master", + "path": "typings", + "bundle": "typings/tsd.d.ts", + "installed": { + "jasmine/jasmine.d.ts": { + "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" + }, + "flux/flux.d.ts": { + "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" + }, + "node/node.d.ts": { + "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" + }, + "react/react.d.ts": { + "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" + }, + "react/react-dom.d.ts": { + "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" + }, + "react/react-addons-test-utils.d.ts": { + "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" + } + } +} diff --git a/react-with-type-safe-flux/webpack.config.js b/react-with-type-safe-flux/webpack.config.js new file mode 100644 index 0000000..70d955b --- /dev/null +++ b/react-with-type-safe-flux/webpack.config.js @@ -0,0 +1,42 @@ +/* eslint-disable no-var, strict, prefer-arrow-callback */ +'use strict'; + +var path = require('path'); + +module.exports = { + cache: true, + entry: { + main: './src/main.tsx', + vendor: [ + 'babel-polyfill', + 'events', + 'flux', + 'react' + ] + }, + output: { + path: path.resolve(__dirname, './dist/scripts'), + filename: '[name].js', + chunkFilename: '[chunkhash].js' + }, + module: { + loaders: [{ + test: /\.ts(x?)$/, + exclude: /node_modules/, + loader: 'babel-loader?presets[]=es2015&presets[]=react!ts-loader' + }, { + test: /\.js$/, + exclude: /node_modules/, + loader: 'babel', + query: { + presets: ['es2015', 'react'] + } + }] + }, + plugins: [ + ], + resolve: { + // Add `.ts` and `.tsx` as a resolvable extension. + extensions: ['', '.webpack.js', '.web.js', '.ts', '.tsx', '.js'] + }, +}; From ceb7a127dc1fa0c0f5b69b492663f9a37537f23a Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Sun, 28 Feb 2016 18:52:52 -0800 Subject: [PATCH 07/63] do not require global tsd --- react-with-type-safe-flux/README.md | 4 ++-- react-with-type-safe-flux/package.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/react-with-type-safe-flux/README.md b/react-with-type-safe-flux/README.md index 8c18bca..351f466 100644 --- a/react-with-type-safe-flux/README.md +++ b/react-with-type-safe-flux/README.md @@ -2,11 +2,11 @@ ## Getting started -You'll need [node / npm](https://nodejs.org/) and [tsd](http://definitelytyped.org/tsd/) installed globally. To get up and running just enter: +You'll need [node / npm](https://nodejs.org/) installed. To get up and running just enter: ``` npm install -tsd install +npm run tsd install npm run serve ``` diff --git a/react-with-type-safe-flux/package.json b/react-with-type-safe-flux/package.json index 04d8f90..74ed7af 100644 --- a/react-with-type-safe-flux/package.json +++ b/react-with-type-safe-flux/package.json @@ -4,11 +4,15 @@ "description": "ES6 + TypeScript + Babel + React + Karma: The Secret Recipe", "main": "index.js", "scripts": { + "tsd": "tsd", "test": "karma start --reporters mocha,junit --single-run --browsers PhantomJS", "serve": "gulp watch-and-serve", "watch": "gulp watch", "build": "gulp build" }, + "bin": { + "tsd": "./node_modules/tsd/build/cli.js" + }, "repository": { "type": "git", "url": "git+https://github.com/microsoft/typescriptsamples.git" @@ -65,6 +69,7 @@ "react-addons-test-utils": "^0.14.3", "react-dom": "^0.14.3", "ts-loader": "^0.8.1", + "tsd": "^0.6.5", "typescript": "^1.8.0", "webpack": "^1.12.2", "webpack-notifier": "^1.2.1" From 7e4eac4546017d4760df2e4086db012ab3dbec54 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Sun, 28 Feb 2016 21:52:22 -0800 Subject: [PATCH 08/63] add type definitions so that it will compile with noImplicitAny: true --- react-with-type-safe-flux/src/components/App.tsx | 4 ++-- .../src/components/Greeting.tsx | 4 ++-- .../src/components/WhoToGreet.tsx | 8 ++++---- .../src/dispatcher/AppDispatcher.ts | 2 +- .../src/stores/FluxStore.ts | 16 ++++++++-------- .../src/stores/GreetingStore.ts | 6 +++--- react-with-type-safe-flux/src/tsconfig.json | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/react-with-type-safe-flux/src/components/App.tsx b/react-with-type-safe-flux/src/components/App.tsx index f6bceb6..7146ac7 100644 --- a/react-with-type-safe-flux/src/components/App.tsx +++ b/react-with-type-safe-flux/src/components/App.tsx @@ -5,8 +5,8 @@ import GreetingState from '../types/GreetingState'; import WhoToGreet from './WhoToGreet'; import Greeting from './Greeting'; -class App extends React.Component { - constructor(props) { +class App extends React.Component<{}, GreetingState> { + constructor(props: {}) { super(props); this.state = this._getStateFromStores(); } diff --git a/react-with-type-safe-flux/src/components/Greeting.tsx b/react-with-type-safe-flux/src/components/Greeting.tsx index 213af66..7d1502b 100644 --- a/react-with-type-safe-flux/src/components/Greeting.tsx +++ b/react-with-type-safe-flux/src/components/Greeting.tsx @@ -7,7 +7,7 @@ interface Props { } class Greeting extends React.Component { - constructor(props) { + constructor(props: Props) { super(props); } @@ -28,7 +28,7 @@ class Greeting extends React.Component { ); } - _onClick = (event) => { + _onClick = (event: React.MouseEvent) => { GreetingActions.removeGreeting(this.props.targetOfGreeting); } } diff --git a/react-with-type-safe-flux/src/components/WhoToGreet.tsx b/react-with-type-safe-flux/src/components/WhoToGreet.tsx index 5e3794f..6712746 100644 --- a/react-with-type-safe-flux/src/components/WhoToGreet.tsx +++ b/react-with-type-safe-flux/src/components/WhoToGreet.tsx @@ -6,7 +6,7 @@ interface Props { } class WhoToGreet extends React.Component { - constructor(props) { + constructor(props: Props) { super(props); } @@ -35,12 +35,12 @@ class WhoToGreet extends React.Component { return !this.props.newGreeting; } - _handleNewGreetingChange = (event) => { - const { target: { value: newGreeting } } = event; + _handleNewGreetingChange = (event: React.FormEvent) => { + const newGreeting = (event.target as HTMLInputElement).value; GreetingActions.newGreetingChanged(newGreeting); } - _onSubmit = (event) => { + _onSubmit = (event: React.FormEvent) => { event.preventDefault(); if (!this._preventSubmission) { diff --git a/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts b/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts index 428b8a6..54daded 100644 --- a/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts +++ b/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts @@ -1,5 +1,5 @@ import { Dispatcher } from 'flux'; -const dispatcherInstance = new Dispatcher(); +const dispatcherInstance: Flux.Dispatcher = new Dispatcher(); export default dispatcherInstance; diff --git a/react-with-type-safe-flux/src/stores/FluxStore.ts b/react-with-type-safe-flux/src/stores/FluxStore.ts index 552aaf7..2326a45 100644 --- a/react-with-type-safe-flux/src/stores/FluxStore.ts +++ b/react-with-type-safe-flux/src/stores/FluxStore.ts @@ -2,19 +2,19 @@ import { EventEmitter } from 'events'; const CHANGE_EVENT = 'change'; -class FluxStore { +class FluxStore { _changed: boolean; _emitter: EventEmitter; dispatchToken: string; - _dispatcher: Flux.Dispatcher; + _dispatcher: Flux.Dispatcher; _cleanStateFn: () => TState; _state: TState; - constructor(dispatcher, cleanStateFn) { + constructor(dispatcher: Flux.Dispatcher, cleanStateFn: () => TState) { this._emitter = new EventEmitter(); this._changed = false; this._dispatcher = dispatcher; - this.dispatchToken = dispatcher.register(payload => { + this.dispatchToken = dispatcher.register((payload: PayloadType) => { this._invokeOnDispatch(payload); }); @@ -31,11 +31,11 @@ class FluxStore { hasChanged() { return this._changed; } - addChangeListener(callback) { + addChangeListener(callback: () => void) { this._emitter.on(CHANGE_EVENT, callback); } - removeChangeListener(callback) { + removeChangeListener(callback: () => void) { this._emitter.removeListener(CHANGE_EVENT, callback); } @@ -44,7 +44,7 @@ class FluxStore { this._state = this._cleanStateFn(); } - _invokeOnDispatch(payload) { + _invokeOnDispatch(payload: PayloadType) { this._changed = false; this._onDispatch(payload); if (this._changed) { @@ -52,7 +52,7 @@ class FluxStore { } } - _onDispatch(payload) { + _onDispatch(payload: PayloadType) { if (process.env.NODE_ENV !== 'production') { console.error(`${this.constructor.name} has not overridden FluxStore.__onDispatch(), which is required`); // eslint-disable-line no-console } diff --git a/react-with-type-safe-flux/src/stores/GreetingStore.ts b/react-with-type-safe-flux/src/stores/GreetingStore.ts index c80dbfc..ba72503 100644 --- a/react-with-type-safe-flux/src/stores/GreetingStore.ts +++ b/react-with-type-safe-flux/src/stores/GreetingStore.ts @@ -3,8 +3,8 @@ import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; import AppDispatcher from '../dispatcher/AppDispatcher'; import GreetingState from '../types/GreetingState'; -class GreeterStore extends FluxStore { - constructor(dispatcher) { +class GreeterStore extends FluxStore { + constructor(dispatcher: Flux.Dispatcher) { super(dispatcher, () => ({ greetings: [], newGreeting: '' @@ -15,7 +15,7 @@ class GreeterStore extends FluxStore { return this._state } - _onDispatch(action) { + _onDispatch(action: any) { switch(action.type) { case GreetingActionTypes.ADD_GREETING: this._state.newGreeting = ''; diff --git a/react-with-type-safe-flux/src/tsconfig.json b/react-with-type-safe-flux/src/tsconfig.json index dbffad0..f116b8b 100644 --- a/react-with-type-safe-flux/src/tsconfig.json +++ b/react-with-type-safe-flux/src/tsconfig.json @@ -9,7 +9,7 @@ "compilerOptions": { "jsx": "preserve", "target": "es6", - "noImplicitAny": false, + "noImplicitAny": true, "removeComments": false, "preserveConstEnums": true, "sourceMap": true From 580b89e228dd29ea00e189bca974d9bf557283cb Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Sun, 28 Feb 2016 23:28:41 -0800 Subject: [PATCH 09/63] introduce Event type in dispatcher --- react-with-type-safe-flux/src/actions/GreetingActions.ts | 8 ++++---- react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts | 6 ++++-- react-with-type-safe-flux/src/stores/FluxStore.ts | 7 +------ react-with-type-safe-flux/src/stores/GreetingStore.ts | 6 +++--- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/react-with-type-safe-flux/src/actions/GreetingActions.ts b/react-with-type-safe-flux/src/actions/GreetingActions.ts index c451280..a69a64b 100644 --- a/react-with-type-safe-flux/src/actions/GreetingActions.ts +++ b/react-with-type-safe-flux/src/actions/GreetingActions.ts @@ -1,23 +1,23 @@ -import AppDispatcher from '../dispatcher/AppDispatcher'; +import {Event, AppDispatcher} from '../dispatcher/AppDispatcher'; import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; export function addGreeting(newGreeting: string) { AppDispatcher.dispatch({ newGreeting, type: GreetingActionTypes.ADD_GREETING - }); + } as Event); } export function newGreetingChanged(newGreeting: string) { AppDispatcher.dispatch({ newGreeting, type: GreetingActionTypes.NEW_GREETING_CHANGED - }); + } as Event); } export function removeGreeting(greetingToRemove: string) { AppDispatcher.dispatch({ greetingToRemove, type: GreetingActionTypes.REMOVE_GREETING - }); + } as Event); } diff --git a/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts b/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts index 54daded..daf21ba 100644 --- a/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts +++ b/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts @@ -1,5 +1,7 @@ import { Dispatcher } from 'flux'; -const dispatcherInstance: Flux.Dispatcher = new Dispatcher(); +export type Event = {type: string}; -export default dispatcherInstance; +const dispatcherInstance: Flux.Dispatcher = new Dispatcher(); + +export const AppDispatcher = dispatcherInstance; diff --git a/react-with-type-safe-flux/src/stores/FluxStore.ts b/react-with-type-safe-flux/src/stores/FluxStore.ts index 2326a45..18beb9a 100644 --- a/react-with-type-safe-flux/src/stores/FluxStore.ts +++ b/react-with-type-safe-flux/src/stores/FluxStore.ts @@ -9,6 +9,7 @@ class FluxStore { _dispatcher: Flux.Dispatcher; _cleanStateFn: () => TState; _state: TState; + protected _onDispatch: (payload: PayloadType) => void; constructor(dispatcher: Flux.Dispatcher, cleanStateFn: () => TState) { this._emitter = new EventEmitter(); @@ -51,12 +52,6 @@ class FluxStore { this._emitter.emit(CHANGE_EVENT); } } - - _onDispatch(payload: PayloadType) { - if (process.env.NODE_ENV !== 'production') { - console.error(`${this.constructor.name} has not overridden FluxStore.__onDispatch(), which is required`); // eslint-disable-line no-console - } - } } export default FluxStore; diff --git a/react-with-type-safe-flux/src/stores/GreetingStore.ts b/react-with-type-safe-flux/src/stores/GreetingStore.ts index ba72503..1e6f726 100644 --- a/react-with-type-safe-flux/src/stores/GreetingStore.ts +++ b/react-with-type-safe-flux/src/stores/GreetingStore.ts @@ -1,6 +1,6 @@ import FluxStore from './FluxStore'; import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; -import AppDispatcher from '../dispatcher/AppDispatcher'; +import {Event, AppDispatcher} from '../dispatcher/AppDispatcher'; import GreetingState from '../types/GreetingState'; class GreeterStore extends FluxStore { @@ -15,8 +15,8 @@ class GreeterStore extends FluxStore { return this._state } - _onDispatch(action: any) { - switch(action.type) { + _onDispatch = (action: any) => { + switch((action).type) { case GreetingActionTypes.ADD_GREETING: this._state.newGreeting = ''; this._state.greetings = this._state.greetings.concat(action.newGreeting); From 4d7b2c1c44074964fc92c3230e70940931117d33 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Mon, 29 Feb 2016 00:01:05 -0800 Subject: [PATCH 10/63] use {type: string; payload: any} as type for actions --- .../src/actions/GreetingActions.ts | 12 +++--- .../src/dispatcher/AppDispatcher.ts | 2 +- .../src/stores/FluxStore.ts | 12 +++--- .../src/stores/GreetingStore.ts | 41 +++++++++---------- .../test/stores/GreetingStore.tests.ts | 8 ++-- 5 files changed, 37 insertions(+), 38 deletions(-) diff --git a/react-with-type-safe-flux/src/actions/GreetingActions.ts b/react-with-type-safe-flux/src/actions/GreetingActions.ts index a69a64b..f484588 100644 --- a/react-with-type-safe-flux/src/actions/GreetingActions.ts +++ b/react-with-type-safe-flux/src/actions/GreetingActions.ts @@ -3,21 +3,21 @@ import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; export function addGreeting(newGreeting: string) { AppDispatcher.dispatch({ - newGreeting, + payload: newGreeting, type: GreetingActionTypes.ADD_GREETING - } as Event); + }); } export function newGreetingChanged(newGreeting: string) { AppDispatcher.dispatch({ - newGreeting, + payload: newGreeting, type: GreetingActionTypes.NEW_GREETING_CHANGED - } as Event); + }); } export function removeGreeting(greetingToRemove: string) { AppDispatcher.dispatch({ - greetingToRemove, + payload: greetingToRemove, type: GreetingActionTypes.REMOVE_GREETING - } as Event); + }); } diff --git a/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts b/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts index daf21ba..ab5248f 100644 --- a/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts +++ b/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts @@ -1,6 +1,6 @@ import { Dispatcher } from 'flux'; -export type Event = {type: string}; +export type Event = {type: string; payload: any}; const dispatcherInstance: Flux.Dispatcher = new Dispatcher(); diff --git a/react-with-type-safe-flux/src/stores/FluxStore.ts b/react-with-type-safe-flux/src/stores/FluxStore.ts index 18beb9a..0aca6c4 100644 --- a/react-with-type-safe-flux/src/stores/FluxStore.ts +++ b/react-with-type-safe-flux/src/stores/FluxStore.ts @@ -1,21 +1,21 @@ import { EventEmitter } from 'events'; +import { Event } from '../dispatcher/AppDispatcher'; const CHANGE_EVENT = 'change'; -class FluxStore { +class FluxStore { _changed: boolean; _emitter: EventEmitter; dispatchToken: string; - _dispatcher: Flux.Dispatcher; + _dispatcher: Flux.Dispatcher; _cleanStateFn: () => TState; _state: TState; - protected _onDispatch: (payload: PayloadType) => void; - constructor(dispatcher: Flux.Dispatcher, cleanStateFn: () => TState) { + constructor(dispatcher: Flux.Dispatcher, protected _onDispatch: (action: Event) => void, cleanStateFn: () => TState) { this._emitter = new EventEmitter(); this._changed = false; this._dispatcher = dispatcher; - this.dispatchToken = dispatcher.register((payload: PayloadType) => { + this.dispatchToken = dispatcher.register((payload: Event) => { this._invokeOnDispatch(payload); }); @@ -45,7 +45,7 @@ class FluxStore { this._state = this._cleanStateFn(); } - _invokeOnDispatch(payload: PayloadType) { + _invokeOnDispatch(payload: Event) { this._changed = false; this._onDispatch(payload); if (this._changed) { diff --git a/react-with-type-safe-flux/src/stores/GreetingStore.ts b/react-with-type-safe-flux/src/stores/GreetingStore.ts index 1e6f726..66d6e78 100644 --- a/react-with-type-safe-flux/src/stores/GreetingStore.ts +++ b/react-with-type-safe-flux/src/stores/GreetingStore.ts @@ -3,9 +3,26 @@ import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; import {Event, AppDispatcher} from '../dispatcher/AppDispatcher'; import GreetingState from '../types/GreetingState'; -class GreeterStore extends FluxStore { - constructor(dispatcher: Flux.Dispatcher) { - super(dispatcher, () => ({ +class GreeterStore extends FluxStore { + constructor(dispatcher: Flux.Dispatcher) { + const onDispatch = (action: Event) => { + switch(action.type) { + case GreetingActionTypes.ADD_GREETING: + this._state.newGreeting = ''; + this._state.greetings = this._state.greetings.concat(action.payload); + this.emitChange(); + break; + case GreetingActionTypes.REMOVE_GREETING: + this._state.greetings = this._state.greetings.filter(g => g !== action.payload); + this.emitChange(); + break; + case GreetingActionTypes.NEW_GREETING_CHANGED: + this._state.newGreeting = action.payload; + this.emitChange(); + break; + } + } + super(dispatcher, onDispatch, () => ({ greetings: [], newGreeting: '' })); @@ -14,24 +31,6 @@ class GreeterStore extends FluxStore { getState() { return this._state } - - _onDispatch = (action: any) => { - switch((action).type) { - case GreetingActionTypes.ADD_GREETING: - this._state.newGreeting = ''; - this._state.greetings = this._state.greetings.concat(action.newGreeting); - this.emitChange(); - break; - case GreetingActionTypes.REMOVE_GREETING: - this._state.greetings = this._state.greetings.filter(g => g !== action.greetingToRemove); - this.emitChange(); - break; - case GreetingActionTypes.NEW_GREETING_CHANGED: - this._state.newGreeting = action.newGreeting; - this.emitChange(); - break; - } - } } const greeterStoreInstance = new GreeterStore(AppDispatcher); diff --git a/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts b/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts index cb536b9..34ef2ca 100644 --- a/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts +++ b/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts @@ -17,7 +17,7 @@ describe('GreetingStore', () => { it('given an ADD_GREETING action with a newGreeting of \'Benjamin\', the newGreeting should be an empty string and greetings should contain \'Benjamin\'', () => { [{ - newGreeting: 'Benjamin', + payload: 'Benjamin', type: GreetingActionTypes.ADD_GREETING, }].forEach(registeredCallback); @@ -29,10 +29,10 @@ describe('GreetingStore', () => { it('given an REMOVE_GREETING action with a greetingToRemove of \'Benjamin\', the state greetings should be an empty array', () => { [{ - newGreeting: 'Benjamin', + payload: 'Benjamin', type: GreetingActionTypes.ADD_GREETING, }, { - greetingToRemove: 'Benjamin', + payload: 'Benjamin', type: GreetingActionTypes.REMOVE_GREETING, }].forEach(registeredCallback); @@ -44,7 +44,7 @@ describe('GreetingStore', () => { it('given a NEW_GREETING_CHANGED action with a newGreeting of \'Benjamin\', the state newGreeting should be \'Benjamin\'', () => { [{ - newGreeting: 'Benjamin', + payload: 'Benjamin', type: GreetingActionTypes.NEW_GREETING_CHANGED, }].forEach(registeredCallback); From 4935670d1e70274bc8534945e0e514eb97009414 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Mon, 29 Feb 2016 00:20:30 -0800 Subject: [PATCH 11/63] add payload types --- .../src/actions/GreetingActions.ts | 10 +++++++--- react-with-type-safe-flux/src/stores/GreetingStore.ts | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/react-with-type-safe-flux/src/actions/GreetingActions.ts b/react-with-type-safe-flux/src/actions/GreetingActions.ts index f484588..8c6ca51 100644 --- a/react-with-type-safe-flux/src/actions/GreetingActions.ts +++ b/react-with-type-safe-flux/src/actions/GreetingActions.ts @@ -1,23 +1,27 @@ import {Event, AppDispatcher} from '../dispatcher/AppDispatcher'; import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; +export interface AddGreetingEvent {type: string; payload: string;} +export interface NewGreetingChanged {type: string; payload: string;} +export interface RemoveGreeting {type: string; payload: string;} + export function addGreeting(newGreeting: string) { AppDispatcher.dispatch({ payload: newGreeting, type: GreetingActionTypes.ADD_GREETING - }); + } as AddGreetingEvent); } export function newGreetingChanged(newGreeting: string) { AppDispatcher.dispatch({ payload: newGreeting, type: GreetingActionTypes.NEW_GREETING_CHANGED - }); + } as NewGreetingChanged); } export function removeGreeting(greetingToRemove: string) { AppDispatcher.dispatch({ payload: greetingToRemove, type: GreetingActionTypes.REMOVE_GREETING - }); + } as RemoveGreeting); } diff --git a/react-with-type-safe-flux/src/stores/GreetingStore.ts b/react-with-type-safe-flux/src/stores/GreetingStore.ts index 66d6e78..e7a8b40 100644 --- a/react-with-type-safe-flux/src/stores/GreetingStore.ts +++ b/react-with-type-safe-flux/src/stores/GreetingStore.ts @@ -2,22 +2,26 @@ import FluxStore from './FluxStore'; import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; import {Event, AppDispatcher} from '../dispatcher/AppDispatcher'; import GreetingState from '../types/GreetingState'; +import { AddGreetingEvent, RemoveGreeting, NewGreetingChanged } from '../actions/GreetingActions'; class GreeterStore extends FluxStore { constructor(dispatcher: Flux.Dispatcher) { const onDispatch = (action: Event) => { switch(action.type) { case GreetingActionTypes.ADD_GREETING: + let payload1 = ( action).payload; this._state.newGreeting = ''; - this._state.greetings = this._state.greetings.concat(action.payload); + this._state.greetings = this._state.greetings.concat(payload1); this.emitChange(); break; case GreetingActionTypes.REMOVE_GREETING: - this._state.greetings = this._state.greetings.filter(g => g !== action.payload); + let payload2 = ( action).payload; + this._state.greetings = this._state.greetings.filter(g => g !== payload2); this.emitChange(); break; case GreetingActionTypes.NEW_GREETING_CHANGED: - this._state.newGreeting = action.payload; + let payload3 = ( action).payload; + this._state.newGreeting = payload3; this.emitChange(); break; } From 5e27fc0eddba50c0105d5ebe218990ca7d67233f Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Mon, 29 Feb 2016 11:17:47 -0800 Subject: [PATCH 12/63] move to TypedEvent --- .../src/actions/GreetingActions.ts | 23 +++++--------- .../src/dispatcher/AppDispatcher.ts | 6 +++- .../src/stores/GreetingStore.ts | 30 ++++++++----------- .../test/stores/GreetingStore.tests.ts | 19 +++--------- 4 files changed, 29 insertions(+), 49 deletions(-) diff --git a/react-with-type-safe-flux/src/actions/GreetingActions.ts b/react-with-type-safe-flux/src/actions/GreetingActions.ts index 8c6ca51..a4cfc7e 100644 --- a/react-with-type-safe-flux/src/actions/GreetingActions.ts +++ b/react-with-type-safe-flux/src/actions/GreetingActions.ts @@ -1,27 +1,18 @@ -import {Event, AppDispatcher} from '../dispatcher/AppDispatcher'; +import {TypedEvent, AppDispatcher} from '../dispatcher/AppDispatcher'; import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; -export interface AddGreetingEvent {type: string; payload: string;} -export interface NewGreetingChanged {type: string; payload: string;} -export interface RemoveGreeting {type: string; payload: string;} +export class AddGreetingEvent extends TypedEvent {} +export class NewGreetingChanged extends TypedEvent {} +export class RemoveGreeting extends TypedEvent {} export function addGreeting(newGreeting: string) { - AppDispatcher.dispatch({ - payload: newGreeting, - type: GreetingActionTypes.ADD_GREETING - } as AddGreetingEvent); + AppDispatcher.dispatch(new AddGreetingEvent(newGreeting)); } export function newGreetingChanged(newGreeting: string) { - AppDispatcher.dispatch({ - payload: newGreeting, - type: GreetingActionTypes.NEW_GREETING_CHANGED - } as NewGreetingChanged); + AppDispatcher.dispatch(new NewGreetingChanged(newGreeting)); } export function removeGreeting(greetingToRemove: string) { - AppDispatcher.dispatch({ - payload: greetingToRemove, - type: GreetingActionTypes.REMOVE_GREETING - } as RemoveGreeting); + AppDispatcher.dispatch(new RemoveGreeting(greetingToRemove)); } diff --git a/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts b/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts index ab5248f..9dfa556 100644 --- a/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts +++ b/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts @@ -1,6 +1,10 @@ import { Dispatcher } from 'flux'; -export type Event = {type: string; payload: any}; +export class TypedEvent

{ + constructor(public payload: P) {} +} + +export type Event = TypedEvent; const dispatcherInstance: Flux.Dispatcher = new Dispatcher(); diff --git a/react-with-type-safe-flux/src/stores/GreetingStore.ts b/react-with-type-safe-flux/src/stores/GreetingStore.ts index e7a8b40..08840b9 100644 --- a/react-with-type-safe-flux/src/stores/GreetingStore.ts +++ b/react-with-type-safe-flux/src/stores/GreetingStore.ts @@ -7,23 +7,19 @@ import { AddGreetingEvent, RemoveGreeting, NewGreetingChanged } from '../actions class GreeterStore extends FluxStore { constructor(dispatcher: Flux.Dispatcher) { const onDispatch = (action: Event) => { - switch(action.type) { - case GreetingActionTypes.ADD_GREETING: - let payload1 = ( action).payload; - this._state.newGreeting = ''; - this._state.greetings = this._state.greetings.concat(payload1); - this.emitChange(); - break; - case GreetingActionTypes.REMOVE_GREETING: - let payload2 = ( action).payload; - this._state.greetings = this._state.greetings.filter(g => g !== payload2); - this.emitChange(); - break; - case GreetingActionTypes.NEW_GREETING_CHANGED: - let payload3 = ( action).payload; - this._state.newGreeting = payload3; - this.emitChange(); - break; + if (action instanceof AddGreetingEvent) { + const {payload} = action; + this._state.newGreeting = ''; + this._state.greetings = this._state.greetings.concat(payload); + this.emitChange(); + } else if (action instanceof RemoveGreeting) { + const {payload} = action; + this._state.greetings = this._state.greetings.filter(g => g !== payload); + this.emitChange(); + } else if (action instanceof NewGreetingChanged) { + const {payload} = action; + this._state.newGreeting = payload; + this.emitChange(); } } super(dispatcher, onDispatch, () => ({ diff --git a/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts b/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts index 34ef2ca..f617a0d 100644 --- a/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts +++ b/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts @@ -1,5 +1,6 @@ import GreetingStore from '../../src/stores/GreetingStore'; import GreetingActionTypes from '../../src/constants/action-types/GreetingActionTypes'; +import { AddGreetingEvent, RemoveGreeting, NewGreetingChanged } from '../../src/actions/GreetingActions'; const registeredCallback = GreetingStore._onDispatch.bind(GreetingStore); @@ -16,10 +17,7 @@ describe('GreetingStore', () => { }); it('given an ADD_GREETING action with a newGreeting of \'Benjamin\', the newGreeting should be an empty string and greetings should contain \'Benjamin\'', () => { - [{ - payload: 'Benjamin', - type: GreetingActionTypes.ADD_GREETING, - }].forEach(registeredCallback); + [new AddGreetingEvent('Benjamin')].forEach(registeredCallback); const { greetings, newGreeting } = GreetingStore.getState(); @@ -28,13 +26,7 @@ describe('GreetingStore', () => { }); it('given an REMOVE_GREETING action with a greetingToRemove of \'Benjamin\', the state greetings should be an empty array', () => { - [{ - payload: 'Benjamin', - type: GreetingActionTypes.ADD_GREETING, - }, { - payload: 'Benjamin', - type: GreetingActionTypes.REMOVE_GREETING, - }].forEach(registeredCallback); + [new AddGreetingEvent('Benjamin'), new RemoveGreeting('Benjamin')].forEach(registeredCallback); const { greetings } = GreetingStore.getState(); @@ -43,10 +35,7 @@ describe('GreetingStore', () => { }); it('given a NEW_GREETING_CHANGED action with a newGreeting of \'Benjamin\', the state newGreeting should be \'Benjamin\'', () => { - [{ - payload: 'Benjamin', - type: GreetingActionTypes.NEW_GREETING_CHANGED, - }].forEach(registeredCallback); + [new NewGreetingChanged('Benjamin')].forEach(registeredCallback); const { newGreeting } = GreetingStore.getState(); From bf765af3129817a1fd1e5f4cc63b7b822a88c07e Mon Sep 17 00:00:00 2001 From: Lennon Jesus Date: Wed, 2 Mar 2016 17:22:19 -0300 Subject: [PATCH 13/63] README.md improvements to help readers to find content --- README.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b488685..2ab80e4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,45 @@ # TypeScript Samples -Samples for TypeScript \ No newline at end of file +> Samples for TypeScript + +##### [AMD Modules](amd/README.md) + +##### [Angular Seed TypeScript](angular1/README.md) + +##### [Angular 2 TypeScript](angular2/README.md) + +##### [Async Functions](async/README.md) + +##### [Browserify](browserify/README.md) + +##### [D3](d3/README.md) + +##### [ES6 + TypeScript + Babel + React + Karma: The Secret Recipe](es6-babel-react-flux-karma/README.md) + +##### [Greeter](greeter/README.md) + +##### [Image Board](imageboard/README.md) + +##### [interfaces](interfaces/README.md) + +##### [JQuery Parallax Starfield](jquery/README.md) + +##### [JSPM](jspm/README.md) + +##### [jsx-demo](jsx/README.md) + +##### [Mankala](mankala/README.md) + +##### [Node.js](node/README.md) + +##### [Raytracer](raytracer/README.md) + +##### [Simple](simple/README.md) + +##### [SystemJS](systemjs/README.md) + +##### [Todo MVC](todomvc/README.md) + +##### [umd](umd/README.md) + +##### [Warship Combat](warship/README.md) From 9bac00fa205d4f06eadbcfe84e49010cabee077a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 2 Mar 2016 13:19:37 -0800 Subject: [PATCH 14/63] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 2ab80e4..2c6db42 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # TypeScript Samples -> Samples for TypeScript - ##### [AMD Modules](amd/README.md) ##### [Angular Seed TypeScript](angular1/README.md) From 5ca2db4d5967c4aa9b51f6704c830d12e646b8d0 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Fri, 18 Mar 2016 08:48:49 -0700 Subject: [PATCH 15/63] update name in README, add link to blog --- react-with-type-safe-flux/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/react-with-type-safe-flux/README.md b/react-with-type-safe-flux/README.md index 351f466..985bf13 100644 --- a/react-with-type-safe-flux/README.md +++ b/react-with-type-safe-flux/README.md @@ -1,4 +1,6 @@ -# ES6 + TypeScript + Babel + React + Karma: The Secret Recipe +# Type-Safe Flux Example + +Based on [ES6 + TypeScript + Babel + React + Karma: The Secret Recipe](../es6-babel-react-flux-karma), see more in corresponding [blog post](https://sameroom.io/blog/type-safe-flux-architecture-using-typescript/). ## Getting started From 17def55674daed3adb7e756fd0232ba6ae690e65 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 18 Mar 2016 12:12:04 -0700 Subject: [PATCH 16/63] Contributing.md changes --- CONTRIBUTING.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a656bec..15374e2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,23 @@ ## Contributing -TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you’ve submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort. -New samples will not be accepted at this time. +## Contributing fixes to existing samples + +A bug must have an issue tracking it in the issue tracker that has been approved (Lable: "help wanted") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort. + +## Contributing new samples + +New samples may be accepted, but will need to first be approved (marked as Lable: "help wanted" by a TypeScript coordinator with the message "Approved") in the suggestion issue. + +For new samples, please provide a detailed explanation of the intended sample, list of technologies or tools used, and an explanation of why existing samples are not sufficient and a new sample is needed. + +A new sample should: +* Include a detailed `readme.md` file discribing how to setup, build and run +* Build against a publiclly released version of the TypeScript toolset +* Only include tools/technolgies that serve the main purpose of the sample +* Work cross-platform ## Legal -You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project’s license, and that the work being submitted is under appropriate copyright. -Please submit a Contributor License Agreement (CLA) before submitting a pull request. Download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190)), sign, scan, and email it back to . Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we’ll review the request. Please note that we’re currently only accepting pull requests of bug fixes rather than new features. \ No newline at end of file +You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. + +Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to . Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. From f97a8a2b2cf90cf112ea69eafa9d531c723baff2 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 18 Mar 2016 12:31:13 -0700 Subject: [PATCH 17/63] Update CONTRIBUTING.md --- CONTRIBUTING.md | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 15374e2..4e7b509 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,22 +2,31 @@ ## Contributing fixes to existing samples -A bug must have an issue tracking it in the issue tracker that has been approved (Lable: "help wanted") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort. +A bug must have an issue tracking it in the issue tracker that has been approved (labeled "help wanted") by the TypeScript team. +Your pull request should include a link to the bug that you are fixing. +If you've submitted a PR for a bug, please post a comment on the issue to avoid duplication of effort. ## Contributing new samples -New samples may be accepted, but will need to first be approved (marked as Lable: "help wanted" by a TypeScript coordinator with the message "Approved") in the suggestion issue. +New samples may be accepted, but will need to first be approved (marked "help wanted" by a TypeScript coordinator with the message "Approved") in the suggestion issue. For new samples, please provide a detailed explanation of the intended sample, list of technologies or tools used, and an explanation of why existing samples are not sufficient and a new sample is needed. A new sample should: -* Include a detailed `readme.md` file discribing how to setup, build and run -* Build against a publiclly released version of the TypeScript toolset -* Only include tools/technolgies that serve the main purpose of the sample -* Work cross-platform + +* include a detailed `README.md` file describing how to setup, build, and run the sample. +* include a `tsconfig.json`. +* build against a publicly released version of the TypeScript toolset. +* only include tools/technolgies that serve the main purpose of the sample (e.g. no test frameworks unless showcasing a test framework). +* work across all platforms. ## Legal -You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. +You will need to complete a Contributor License Agreement (CLA). +Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. -Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to . Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. +Please submit a Contributor License Agreement (CLA) before submitting a pull request. +You may visit https://cla.microsoft.com to sign digitally. +Alternatively, download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to . +Be sure to include your github user name along with the agreement. +Once we have received the signed CLA, we'll review the request. From 28780d604f41995da8c14c791552f090fdec2f35 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 18 Mar 2016 13:07:16 -0700 Subject: [PATCH 18/63] Review comments --- CONTRIBUTING.md | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4e7b509..515f405 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,23 +2,31 @@ ## Contributing fixes to existing samples -A bug must have an issue tracking it in the issue tracker that has been approved (labeled "help wanted") by the TypeScript team. +A bug must have an issue tracking it in the issue tracker that has been approved (Lable: "help wanted") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. -If you've submitted a PR for a bug, please post a comment on the issue to avoid duplication of effort. +If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort. ## Contributing new samples -New samples may be accepted, but will need to first be approved (marked "help wanted" by a TypeScript coordinator with the message "Approved") in the suggestion issue. +New samples may be accepted, but will need to first be approved (marked as Label: "help wanted" by a TypeScript coordinator) in the suggestion issue. For new samples, please provide a detailed explanation of the intended sample, list of technologies or tools used, and an explanation of why existing samples are not sufficient and a new sample is needed. -A new sample should: +A sample is meant to showcase a specific technology or toolchain integration with TypeScript; a sample is not meant to be a template that users would use to get a project going. +A sample should only include tools/technologies that serve the main technology it covers; for instance, a sample for a UI framework should not include a test framework integration. -* include a detailed `README.md` file describing how to setup, build, and run the sample. -* include a `tsconfig.json`. -* build against a publicly released version of the TypeScript toolset. -* only include tools/technolgies that serve the main purpose of the sample (e.g. no test frameworks unless showcasing a test framework). -* work across all platforms. +A sample should be well documented. +Please include comments in `readme.md` explaining why steps are being taken, including in build files if applicable. +A good sample `readme.md` should read like a walkthrough, guiding the reader through different steps of setting up and building the sample. +See [TypeScript quick start samples](https://github.com/Microsoft/TypeScript-Handbook/tree/master/pages/quick-start) for guidance. + +A sample should be self-contained. +[npm](https://www.npmjs.com/) is the recommended way of acquiring dependencies. +[typings](https://github.com/typings/typings) is the recommended way of acquiring definition files. + +A sample should be IDE/editor-friendly. Please include a `tsconfig.json` file at the root. + +A sample should have no OS dependency. ## Legal @@ -28,5 +36,4 @@ Briefly, this agreement testifies that you are granting us permission to use the Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to . -Be sure to include your github user name along with the agreement. -Once we have received the signed CLA, we'll review the request. +Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. From 5fb0f810a58eea35dafc3edf03557c438e4fccb2 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 18 Mar 2016 13:11:50 -0700 Subject: [PATCH 19/63] Update CONTRIBUTING.md --- CONTRIBUTING.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 515f405..0305bd6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,22 +2,23 @@ ## Contributing fixes to existing samples -A bug must have an issue tracking it in the issue tracker that has been approved (Lable: "help wanted") by the TypeScript team. +A bug must have an issue tracking it in the issue tracker that has been approved (labeled "help wanted") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort. ## Contributing new samples -New samples may be accepted, but will need to first be approved (marked as Label: "help wanted" by a TypeScript coordinator) in the suggestion issue. +New samples may be accepted, but will need to first be approved (labeled "help wanted" by a TypeScript coordinator) in the suggestion issue. For new samples, please provide a detailed explanation of the intended sample, list of technologies or tools used, and an explanation of why existing samples are not sufficient and a new sample is needed. -A sample is meant to showcase a specific technology or toolchain integration with TypeScript; a sample is not meant to be a template that users would use to get a project going. +A sample is meant to showcase a specific technology or toolchain integration with TypeScript; it is not meant to be a template that users would use to get a project going. A sample should only include tools/technologies that serve the main technology it covers; for instance, a sample for a UI framework should not include a test framework integration. A sample should be well documented. -Please include comments in `readme.md` explaining why steps are being taken, including in build files if applicable. -A good sample `readme.md` should read like a walkthrough, guiding the reader through different steps of setting up and building the sample. +Please include comments in code as well as content in the a `README.md` explaining why steps are being taken. +Comments should also be included in build files if applicable. +A good sample `README.md` should read like a walkthrough, guiding the reader through different steps of setting up and building the sample. See [TypeScript quick start samples](https://github.com/Microsoft/TypeScript-Handbook/tree/master/pages/quick-start) for guidance. A sample should be self-contained. @@ -36,4 +37,4 @@ Briefly, this agreement testifies that you are granting us permission to use the Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to . -Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. +Be sure to include your GitHub user name along with the agreement. Once we have received the signed CLA, we'll review the request. From 4f44c8580930ceba245c87c195fd0ad3455004e9 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 23 Mar 2016 23:24:45 -0700 Subject: [PATCH 20/63] Fixed the 'tsc' command in 'package.json'. --- browserify/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browserify/package.json b/browserify/package.json index fc11a8e..a7fffc5 100644 --- a/browserify/package.json +++ b/browserify/package.json @@ -13,9 +13,9 @@ "typescript": "^1.5.3" }, "scripts": { - "tsc": "node node_modules/typescript/bin/tsc.js", + "tsc": "node node_modules/typescript/lib/tsc.js", "browserify": "browserify src/app.js -o bundle.js -s app", "listen": "node node_modules/http-server/bin/http-server", "all": "npm run tsc && npm run browserify && npm run listen" } -} \ No newline at end of file +} From fd6b20712b3d0f2e68bf9a82e5c7aa733f40ce87 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 23 Mar 2016 23:27:00 -0700 Subject: [PATCH 21/63] Updated TypeScript dependency. --- browserify/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browserify/package.json b/browserify/package.json index a7fffc5..d6b3f94 100644 --- a/browserify/package.json +++ b/browserify/package.json @@ -10,7 +10,7 @@ "http-server": "0.8.0" }, "devDependencies": { - "typescript": "^1.5.3" + "typescript": "^1.8.9" }, "scripts": { "tsc": "node node_modules/typescript/lib/tsc.js", From de378e5fdd4f8310ecedac0789adf3a6d55d5e64 Mon Sep 17 00:00:00 2001 From: "Paul D. Fernhout" Date: Fri, 25 Mar 2016 19:18:03 -0400 Subject: [PATCH 22/63] Fixed typo in comment in jquery/parallax.ts --- jquery/parallax.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery/parallax.ts b/jquery/parallax.ts index eb772bc..4c81bca 100644 --- a/jquery/parallax.ts +++ b/jquery/parallax.ts @@ -10,7 +10,7 @@ module Parallax { * Creates a Container for a Parallax * * @param {HTMLElement} scrollableContent The container that will be parallaxed - * @param {perspective} perspective The ratio of how much back content should be scroleld relative to forward content. For example, if this value is 0.5, and there are 2 surfaces, + * @param {perspective} perspective The ratio of how much back content should be scrolled relative to forward content. For example, if this value is 0.5, and there are 2 surfaces, * the front-most surface would be scrolled normally, and the surface behind it would be scrolled half as much. */ constructor(scrollableContent: HTMLElement, From b5b29af70a4412e2a6fd55e062c99f6821ea2e2a Mon Sep 17 00:00:00 2001 From: John Reilly Date: Mon, 28 Mar 2016 14:46:40 +0100 Subject: [PATCH 23/63] tsd -> typings --- es6-babel-react-flux-karma/README.md | 6 +-- es6-babel-react-flux-karma/gulp/tests.js | 45 +++++++++++++------ es6-babel-react-flux-karma/gulp/webpack.js | 8 ++-- es6-babel-react-flux-karma/package.json | 6 +-- es6-babel-react-flux-karma/src/tsconfig.json | 15 +++---- es6-babel-react-flux-karma/test/tsconfig.json | 15 +++---- es6-babel-react-flux-karma/tsd.json | 27 ----------- es6-babel-react-flux-karma/typings.json | 12 +++++ 8 files changed, 69 insertions(+), 65 deletions(-) delete mode 100644 es6-babel-react-flux-karma/tsd.json create mode 100644 es6-babel-react-flux-karma/typings.json diff --git a/es6-babel-react-flux-karma/README.md b/es6-babel-react-flux-karma/README.md index 8c18bca..60871c1 100644 --- a/es6-babel-react-flux-karma/README.md +++ b/es6-babel-react-flux-karma/README.md @@ -2,18 +2,18 @@ ## Getting started -You'll need [node / npm](https://nodejs.org/) and [tsd](http://definitelytyped.org/tsd/) installed globally. To get up and running just enter: +You'll need [node / npm](https://nodejs.org/) and [Typings](https://github.com/typings/typings) installed globally. To get up and running just enter: ``` npm install -tsd install +typings install npm run serve ``` This will: 1. Download the npm packages you need -2. Download the typings from DefinitelyTyped that you need. +2. Download the type definitions you need. 3. Compile the code and serve it up at [http://localhost:8080](http://localhost:8080) Now you need dev tools. There's a world of choice out there; there's [Atom](https://atom.io/), there's [VS Code](https://www.visualstudio.com/en-us/products/code-vs.aspx), there's [Sublime](http://www.sublimetext.com/). There's even something called [Visual Studio](http://www.visualstudio.com). It's all your choice really. diff --git a/es6-babel-react-flux-karma/gulp/tests.js b/es6-babel-react-flux-karma/gulp/tests.js index 4d6ba04..05af0a5 100644 --- a/es6-babel-react-flux-karma/gulp/tests.js +++ b/es6-babel-react-flux-karma/gulp/tests.js @@ -4,23 +4,42 @@ var Server = require('karma').Server; var path = require('path'); var gutil = require('gulp-util'); -module.exports = { - watch: function() { - // Documentation: https://karma-runner.github.io/0.13/dev/public-api.html - var karmaConfig = { - configFile: path.join(__dirname, '../karma.conf.js'), - singleRun: false, +function runTests(options) { + // Documentation: https://karma-runner.github.io/0.13/dev/public-api.html + var karmaConfig = { + configFile: path.join(__dirname, '../karma.conf.js'), + singleRun: !options.shouldWatch, + + plugins: ['karma-webpack', 'karma-jasmine', 'karma-mocha-reporter', 'karma-sourcemap-loader', 'karma-phantomjs-launcher'], + reporters: ['mocha'] + }; - // Fancy runner - plugins: ['karma-webpack', 'karma-jasmine', 'karma-mocha-reporter', /*'karma-junit-reporter', 'karma-coverage', */'karma-sourcemap-loader', 'karma-phantomjs-launcher'], - reporters: ['mocha'] - }; + if (options.done) { + karmaConfig.plugins.push('karma-junit-reporter'); + karmaConfig.reporters.push('junit'); + } else { + karmaConfig.plugins.push('karma-notify-reporter'); + karmaConfig.reporters.push('notify'); + } - new Server(karmaConfig, karmaCompleted).start(); + new Server(karmaConfig, karmaCompleted).start(); - function karmaCompleted(exitCode) { - gutil.log('Karma has exited with:', exitCode); + function karmaCompleted(exitCode) { + if (options.done) { + if (exitCode === 1) { + gutil.log('Karma: tests failed with code ' + exitCode); + } else { + gutil.log('Karma completed!'); + } + options.done(); + } + else { process.exit(exitCode); } } +} + +module.exports = { + run: function(done) { return runTests({ shouldWatch: false, done: done }); }, + watch: function() { return runTests({ shouldWatch: true }); } }; diff --git a/es6-babel-react-flux-karma/gulp/webpack.js b/es6-babel-react-flux-karma/gulp/webpack.js index 37c4ded..65af421 100644 --- a/es6-babel-react-flux-karma/gulp/webpack.js +++ b/es6-babel-react-flux-karma/gulp/webpack.js @@ -3,6 +3,7 @@ var gulp = require('gulp'); var gutil = require('gulp-util'); var webpack = require('webpack'); +var failPlugin = require('webpack-fail-plugin'); var WebpackNotifierPlugin = require('webpack-notifier'); var webpackConfig = require('../webpack.config.js'); @@ -14,12 +15,13 @@ function buildProduction(done) { myProdConfig.plugins = myProdConfig.plugins.concat( new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.[hash].js' }), new webpack.optimize.DedupePlugin(), - new webpack.optimize.UglifyJsPlugin() + new webpack.optimize.UglifyJsPlugin(), + failPlugin ); // run webpack webpack(myProdConfig, function(err, stats) { - if(err) { throw new gutil.PluginError('webpack:build', err); } + if (err) { throw new gutil.PluginError('webpack:build', err); } gutil.log('[webpack:build]', stats.toString({ colors: true })); @@ -46,7 +48,7 @@ function createDevCompiler() { function buildDevelopment(done, devCompiler) { // run webpack devCompiler.run(function(err, stats) { - if(err) { throw new gutil.PluginError('webpack:build-dev', err); } + if (err) { throw new gutil.PluginError('webpack:build-dev', err); } gutil.log('[webpack:build-dev]', stats.toString({ chunks: false, colors: true diff --git a/es6-babel-react-flux-karma/package.json b/es6-babel-react-flux-karma/package.json index 04d8f90..21fd63b 100644 --- a/es6-babel-react-flux-karma/package.json +++ b/es6-babel-react-flux-karma/package.json @@ -54,12 +54,11 @@ "karma-coverage": "^0.5.2", "karma-jasmine": "^0.3.6", "karma-junit-reporter": "^0.3.7", - "karma-mocha-reporter": "^1.1.1", + "karma-mocha-reporter": "^2.0.0", + "karma-notify-reporter": "^0.1.1", "karma-phantomjs-launcher": "^1.0.0", - "karma-phantomjs-shim": "^1.1.1", "karma-sourcemap-loader": "^0.3.6", "karma-webpack": "^1.7.0", - "phantomjs": "^2.1.3", "phantomjs-prebuilt": "^2.1.4", "react": "^0.14.3", "react-addons-test-utils": "^0.14.3", @@ -67,6 +66,7 @@ "ts-loader": "^0.8.1", "typescript": "^1.8.0", "webpack": "^1.12.2", + "webpack-fail-plugin": "^1.0.4", "webpack-notifier": "^1.2.1" } } diff --git a/es6-babel-react-flux-karma/src/tsconfig.json b/es6-babel-react-flux-karma/src/tsconfig.json index dbffad0..bed179c 100644 --- a/es6-babel-react-flux-karma/src/tsconfig.json +++ b/es6-babel-react-flux-karma/src/tsconfig.json @@ -1,9 +1,9 @@ { "compileOnSave": false, "filesGlob": [ - "../typings/**/*.*.ts", - "!../typings/jasmine/jasmine.d.ts", - "!../typings/react/react-addons-test-utils.d.ts", + "../typings/browser/**/*.*.ts", + "!../typings/browser/ambient/jasmine/index.d.ts", + "!../typings/browser/ambient/react-addons-test-utils/index.d.ts", "**/*.{ts,tsx}" ], "compilerOptions": { @@ -15,11 +15,10 @@ "sourceMap": true }, "files": [ - "../typings/flux/flux.d.ts", - "../typings/node/node.d.ts", - "../typings/react/react-dom.d.ts", - "../typings/react/react.d.ts", - "../typings/tsd.d.ts", + "../typings/browser/ambient/flux/index.d.ts", + "../typings/browser/ambient/node/index.d.ts", + "../typings/browser/ambient/react-dom/index.d.ts", + "../typings/browser/ambient/react/index.d.ts", "actions/GreetingActions.ts", "components/App.tsx", "components/Greeting.tsx", diff --git a/es6-babel-react-flux-karma/test/tsconfig.json b/es6-babel-react-flux-karma/test/tsconfig.json index 368d9d5..9755c70 100644 --- a/es6-babel-react-flux-karma/test/tsconfig.json +++ b/es6-babel-react-flux-karma/test/tsconfig.json @@ -2,7 +2,7 @@ "compileOnSave": false, "filesGlob": [ "**/*.{ts,tsx}", - "../typings/**/*.*.ts" + "../typings/browser/**/*.*.ts" ], "compilerOptions": { "jsx": "preserve", @@ -19,13 +19,12 @@ "components/Greeting.tests.tsx", "components/WhoToGreet.tests.tsx", "stores/GreetingStore.tests.ts", - "../typings/flux/flux.d.ts", - "../typings/jasmine/jasmine.d.ts", - "../typings/node/node.d.ts", - "../typings/react/react-addons-test-utils.d.ts", - "../typings/react/react-dom.d.ts", - "../typings/react/react.d.ts", - "../typings/tsd.d.ts" + "../typings/browser/ambient/flux/index.d.ts", + "../typings/browser/ambient/jasmine/index.d.ts", + "../typings/browser/ambient/node/index.d.ts", + "../typings/browser/ambient/react-addons-test-utils/index.d.ts", + "../typings/browser/ambient/react-dom/index.d.ts", + "../typings/browser/ambient/react/index.d.ts" ], "exclude": [], "atom": { diff --git a/es6-babel-react-flux-karma/tsd.json b/es6-babel-react-flux-karma/tsd.json deleted file mode 100644 index 2716a22..0000000 --- a/es6-babel-react-flux-karma/tsd.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": "v4", - "repo": "borisyankov/DefinitelyTyped", - "ref": "master", - "path": "typings", - "bundle": "typings/tsd.d.ts", - "installed": { - "jasmine/jasmine.d.ts": { - "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" - }, - "flux/flux.d.ts": { - "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" - }, - "node/node.d.ts": { - "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" - }, - "react/react.d.ts": { - "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" - }, - "react/react-dom.d.ts": { - "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" - }, - "react/react-addons-test-utils.d.ts": { - "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" - } - } -} diff --git a/es6-babel-react-flux-karma/typings.json b/es6-babel-react-flux-karma/typings.json new file mode 100644 index 0000000..4be13c1 --- /dev/null +++ b/es6-babel-react-flux-karma/typings.json @@ -0,0 +1,12 @@ +{ + "name": "es6-babel-react-flux-karma", + "version": false, + "ambientDependencies": { + "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054", + "flux": "github:DefinitelyTyped/DefinitelyTyped/flux/flux.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054", + "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054", + "react": "github:DefinitelyTyped/DefinitelyTyped/react/react.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054", + "react-dom": "github:DefinitelyTyped/DefinitelyTyped/react/react-dom.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054", + "react-addons-test-utils": "github:DefinitelyTyped/DefinitelyTyped/react/react-addons-test-utils.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054" + } +} From 468e0f1565a2338a22f0a1c802c40b13e07e0755 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 28 Mar 2016 13:44:44 -0700 Subject: [PATCH 24/63] Perform the merge + fixups. --- es6-babel-react-flux-karma/README.md | 4 +- .../src/actions/GreetingActions.ts | 22 +++---- .../src/components/App.tsx | 23 ++++--- .../src/components/Greeting.tsx | 4 +- .../src/components/WhoToGreet.tsx | 8 +-- .../action-types/GreetingActionTypes.ts | 7 -- .../src/dispatcher/AppDispatcher.ts | 10 ++- es6-babel-react-flux-karma/src/index.html | 2 +- .../src/stores/FluxStore.ts | 64 +++++++++---------- .../src/stores/GreetingStore.ts | 46 ++++++------- es6-babel-react-flux-karma/src/tsconfig.json | 8 +-- .../test/components/App.tests.tsx | 2 +- .../test/stores/GreetingStore.tests.ts | 24 ++----- es6-babel-react-flux-karma/test/tsconfig.json | 19 +++--- 14 files changed, 107 insertions(+), 136 deletions(-) delete mode 100644 es6-babel-react-flux-karma/src/constants/action-types/GreetingActionTypes.ts diff --git a/es6-babel-react-flux-karma/README.md b/es6-babel-react-flux-karma/README.md index 60871c1..bdefa0b 100644 --- a/es6-babel-react-flux-karma/README.md +++ b/es6-babel-react-flux-karma/README.md @@ -1,4 +1,4 @@ -# ES6 + TypeScript + Babel + React + Karma: The Secret Recipe +# TypeScript, Babel, React, and Karma Sample ## Getting started @@ -13,7 +13,7 @@ npm run serve This will: 1. Download the npm packages you need -2. Download the type definitions you need. +2. Download the type definitions from DefinitelyTyped that you need. 3. Compile the code and serve it up at [http://localhost:8080](http://localhost:8080) Now you need dev tools. There's a world of choice out there; there's [Atom](https://atom.io/), there's [VS Code](https://www.visualstudio.com/en-us/products/code-vs.aspx), there's [Sublime](http://www.sublimetext.com/). There's even something called [Visual Studio](http://www.visualstudio.com). It's all your choice really. diff --git a/es6-babel-react-flux-karma/src/actions/GreetingActions.ts b/es6-babel-react-flux-karma/src/actions/GreetingActions.ts index c451280..147db5a 100644 --- a/es6-babel-react-flux-karma/src/actions/GreetingActions.ts +++ b/es6-babel-react-flux-karma/src/actions/GreetingActions.ts @@ -1,23 +1,17 @@ -import AppDispatcher from '../dispatcher/AppDispatcher'; -import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; +import {TypedEvent, AppDispatcher} from '../dispatcher/AppDispatcher'; + +export class AddGreetingEvent extends TypedEvent {} +export class NewGreetingChanged extends TypedEvent {} +export class RemoveGreeting extends TypedEvent {} export function addGreeting(newGreeting: string) { - AppDispatcher.dispatch({ - newGreeting, - type: GreetingActionTypes.ADD_GREETING - }); + AppDispatcher.dispatch(new AddGreetingEvent(newGreeting)); } export function newGreetingChanged(newGreeting: string) { - AppDispatcher.dispatch({ - newGreeting, - type: GreetingActionTypes.NEW_GREETING_CHANGED - }); + AppDispatcher.dispatch(new NewGreetingChanged(newGreeting)); } export function removeGreeting(greetingToRemove: string) { - AppDispatcher.dispatch({ - greetingToRemove, - type: GreetingActionTypes.REMOVE_GREETING - }); + AppDispatcher.dispatch(new RemoveGreeting(greetingToRemove)); } diff --git a/es6-babel-react-flux-karma/src/components/App.tsx b/es6-babel-react-flux-karma/src/components/App.tsx index f6bceb6..e43face 100644 --- a/es6-babel-react-flux-karma/src/components/App.tsx +++ b/es6-babel-react-flux-karma/src/components/App.tsx @@ -5,18 +5,21 @@ import GreetingState from '../types/GreetingState'; import WhoToGreet from './WhoToGreet'; import Greeting from './Greeting'; -class App extends React.Component { - constructor(props) { +class App extends React.Component<{}, GreetingState> { + constructor(props: {}) { super(props); - this.state = this._getStateFromStores(); + this.state = this.getStateFromStores(); + } + private onChange = () => { + this.setState(this.getStateFromStores()); } - componentWillMount() { - GreetingStore.addChangeListener(this._onChange); + public componentWillMount() { + GreetingStore.addChangeListener(this.onChange); } - componentWillUnmount() { - GreetingStore.removeChangeListener(this._onChange); + public componentWillUnmount() { + GreetingStore.removeChangeListener(this.onChange); } render() { @@ -32,11 +35,7 @@ class App extends React.Component { ); } - _onChange = () => { - this.setState(this._getStateFromStores()); - } - - _getStateFromStores() { + private getStateFromStores() { return GreetingStore.getState(); } } diff --git a/es6-babel-react-flux-karma/src/components/Greeting.tsx b/es6-babel-react-flux-karma/src/components/Greeting.tsx index 213af66..7d1502b 100644 --- a/es6-babel-react-flux-karma/src/components/Greeting.tsx +++ b/es6-babel-react-flux-karma/src/components/Greeting.tsx @@ -7,7 +7,7 @@ interface Props { } class Greeting extends React.Component { - constructor(props) { + constructor(props: Props) { super(props); } @@ -28,7 +28,7 @@ class Greeting extends React.Component { ); } - _onClick = (event) => { + _onClick = (event: React.MouseEvent) => { GreetingActions.removeGreeting(this.props.targetOfGreeting); } } diff --git a/es6-babel-react-flux-karma/src/components/WhoToGreet.tsx b/es6-babel-react-flux-karma/src/components/WhoToGreet.tsx index 5e3794f..6712746 100644 --- a/es6-babel-react-flux-karma/src/components/WhoToGreet.tsx +++ b/es6-babel-react-flux-karma/src/components/WhoToGreet.tsx @@ -6,7 +6,7 @@ interface Props { } class WhoToGreet extends React.Component { - constructor(props) { + constructor(props: Props) { super(props); } @@ -35,12 +35,12 @@ class WhoToGreet extends React.Component { return !this.props.newGreeting; } - _handleNewGreetingChange = (event) => { - const { target: { value: newGreeting } } = event; + _handleNewGreetingChange = (event: React.FormEvent) => { + const newGreeting = (event.target as HTMLInputElement).value; GreetingActions.newGreetingChanged(newGreeting); } - _onSubmit = (event) => { + _onSubmit = (event: React.FormEvent) => { event.preventDefault(); if (!this._preventSubmission) { diff --git a/es6-babel-react-flux-karma/src/constants/action-types/GreetingActionTypes.ts b/es6-babel-react-flux-karma/src/constants/action-types/GreetingActionTypes.ts deleted file mode 100644 index ef9fda4..0000000 --- a/es6-babel-react-flux-karma/src/constants/action-types/GreetingActionTypes.ts +++ /dev/null @@ -1,7 +0,0 @@ -const GreetingActionTypes = { - ADD_GREETING: 'GreetingActionTypes.ADD_GREETING', - REMOVE_GREETING: 'GreetingActionTypes.REMOVE_GREETING', - NEW_GREETING_CHANGED: 'GreetingActionTypes.NEW_GREETING_CHANGED' -}; - -export default GreetingActionTypes; diff --git a/es6-babel-react-flux-karma/src/dispatcher/AppDispatcher.ts b/es6-babel-react-flux-karma/src/dispatcher/AppDispatcher.ts index 428b8a6..83f413c 100644 --- a/es6-babel-react-flux-karma/src/dispatcher/AppDispatcher.ts +++ b/es6-babel-react-flux-karma/src/dispatcher/AppDispatcher.ts @@ -1,5 +1,11 @@ import { Dispatcher } from 'flux'; -const dispatcherInstance = new Dispatcher(); +export class TypedEvent

{ + constructor(public payload: P) {} +} -export default dispatcherInstance; +export type Event = TypedEvent; + +const dispatcherInstance: Flux.Dispatcher = new Dispatcher(); + +export { dispatcherInstance as AppDispatcher }; diff --git a/es6-babel-react-flux-karma/src/index.html b/es6-babel-react-flux-karma/src/index.html index c5c150d..16013fa 100644 --- a/es6-babel-react-flux-karma/src/index.html +++ b/es6-babel-react-flux-karma/src/index.html @@ -5,7 +5,7 @@ - ES6 + Babel + React + Flux + Karma: The Secret Recipe + TypeScript, Babel, React, Flux, and Karma diff --git a/es6-babel-react-flux-karma/src/stores/FluxStore.ts b/es6-babel-react-flux-karma/src/stores/FluxStore.ts index 552aaf7..4ef8407 100644 --- a/es6-babel-react-flux-karma/src/stores/FluxStore.ts +++ b/es6-babel-react-flux-karma/src/stores/FluxStore.ts @@ -1,60 +1,56 @@ import { EventEmitter } from 'events'; +import { Event } from '../dispatcher/AppDispatcher'; +import * as Flux from "flux"; const CHANGE_EVENT = 'change'; class FluxStore { - _changed: boolean; - _emitter: EventEmitter; - dispatchToken: string; - _dispatcher: Flux.Dispatcher; - _cleanStateFn: () => TState; - _state: TState; - - constructor(dispatcher, cleanStateFn) { - this._emitter = new EventEmitter(); - this._changed = false; - this._dispatcher = dispatcher; + private changed: boolean; + private emitter: EventEmitter; + private dispatchToken: string; + private dispatcher: Flux.Dispatcher; + private cleanStateFn: () => TState; + protected state: TState; + + constructor(dispatcher: Flux.Dispatcher, public onDispatch: (action: Event) => void, cleanStateFn: () => TState) { + this.emitter = new EventEmitter(); + this.changed = false; + this.dispatcher = dispatcher; this.dispatchToken = dispatcher.register(payload => { - this._invokeOnDispatch(payload); + this.invokeOnDispatch(payload); }); - this._cleanStateFn = cleanStateFn; - this._state = this._cleanStateFn(); + this.cleanStateFn = cleanStateFn; + this.state = this.cleanStateFn(); } /** * Is idempotent per dispatched event */ emitChange() { - this._changed = true; + this.changed = true; } - hasChanged() { return this._changed; } + hasChanged() { return this.changed; } - addChangeListener(callback) { - this._emitter.on(CHANGE_EVENT, callback); + addChangeListener(callback: () => void) { + this.emitter.on(CHANGE_EVENT, callback); } - removeChangeListener(callback) { - this._emitter.removeListener(CHANGE_EVENT, callback); + removeChangeListener(callback: () => void) { + this.emitter.removeListener(CHANGE_EVENT, callback); } - _cleanState() { - this._changed = false; - this._state = this._cleanStateFn(); + protected cleanState() { + this.changed = false; + this.state = this.cleanStateFn(); } - _invokeOnDispatch(payload) { - this._changed = false; - this._onDispatch(payload); - if (this._changed) { - this._emitter.emit(CHANGE_EVENT); - } - } - - _onDispatch(payload) { - if (process.env.NODE_ENV !== 'production') { - console.error(`${this.constructor.name} has not overridden FluxStore.__onDispatch(), which is required`); // eslint-disable-line no-console + private invokeOnDispatch(payload: Event) { + this.changed = false; + this.onDispatch(payload); + if (this.changed) { + this.emitter.emit(CHANGE_EVENT); } } } diff --git a/es6-babel-react-flux-karma/src/stores/GreetingStore.ts b/es6-babel-react-flux-karma/src/stores/GreetingStore.ts index c80dbfc..2846175 100644 --- a/es6-babel-react-flux-karma/src/stores/GreetingStore.ts +++ b/es6-babel-react-flux-karma/src/stores/GreetingStore.ts @@ -1,36 +1,36 @@ import FluxStore from './FluxStore'; -import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; -import AppDispatcher from '../dispatcher/AppDispatcher'; +import {Event, AppDispatcher} from '../dispatcher/AppDispatcher'; import GreetingState from '../types/GreetingState'; +import { AddGreetingEvent, RemoveGreeting, NewGreetingChanged } from '../actions/GreetingActions'; class GreeterStore extends FluxStore { - constructor(dispatcher) { - super(dispatcher, () => ({ + constructor(dispatcher: Flux.Dispatcher) { + const onDispatch = (action: Event) => { + if (action instanceof AddGreetingEvent) { + const { payload } = action; + this.state.newGreeting = ''; + this.state.greetings = this.state.greetings.concat(payload); + this.emitChange(); + } + else if (action instanceof RemoveGreeting) { + const {payload} = action; + this.state.greetings = this.state.greetings.filter(g => g !== payload); + this.emitChange(); + } + else if (action instanceof NewGreetingChanged) { + const {payload} = action; + this.state.newGreeting = payload; + this.emitChange(); + } + } + super(dispatcher, onDispatch, () => ({ greetings: [], newGreeting: '' })); } getState() { - return this._state - } - - _onDispatch(action) { - switch(action.type) { - case GreetingActionTypes.ADD_GREETING: - this._state.newGreeting = ''; - this._state.greetings = this._state.greetings.concat(action.newGreeting); - this.emitChange(); - break; - case GreetingActionTypes.REMOVE_GREETING: - this._state.greetings = this._state.greetings.filter(g => g !== action.greetingToRemove); - this.emitChange(); - break; - case GreetingActionTypes.NEW_GREETING_CHANGED: - this._state.newGreeting = action.newGreeting; - this.emitChange(); - break; - } + return this.state } } diff --git a/es6-babel-react-flux-karma/src/tsconfig.json b/es6-babel-react-flux-karma/src/tsconfig.json index bed179c..5abc4cb 100644 --- a/es6-babel-react-flux-karma/src/tsconfig.json +++ b/es6-babel-react-flux-karma/src/tsconfig.json @@ -9,28 +9,26 @@ "compilerOptions": { "jsx": "preserve", "target": "es6", - "noImplicitAny": false, + "noImplicitAny": true, "removeComments": false, "preserveConstEnums": true, "sourceMap": true }, "files": [ + "../typings/browser/ambient/react/index.d.ts", + "../typings/browser/ambient/react-dom/index.d.ts", "../typings/browser/ambient/flux/index.d.ts", "../typings/browser/ambient/node/index.d.ts", - "../typings/browser/ambient/react-dom/index.d.ts", - "../typings/browser/ambient/react/index.d.ts", "actions/GreetingActions.ts", "components/App.tsx", "components/Greeting.tsx", "components/WhoToGreet.tsx", - "constants/action-types/GreetingActionTypes.ts", "dispatcher/AppDispatcher.ts", "main.tsx", "stores/FluxStore.ts", "stores/GreetingStore.ts", "types/GreetingState.ts" ], - "exclude": [], "atom": { "rewriteTsconfig": true } diff --git a/es6-babel-react-flux-karma/test/components/App.tests.tsx b/es6-babel-react-flux-karma/test/components/App.tests.tsx index 1530e64..42b1bf9 100644 --- a/es6-babel-react-flux-karma/test/components/App.tests.tsx +++ b/es6-babel-react-flux-karma/test/components/App.tests.tsx @@ -21,7 +21,7 @@ describe('App', () => { ); }); - function render(state) { + function render(state: any) { const shallowRenderer = TestUtils.createRenderer(); spyOn(GreetingStore, 'getState').and.returnValue(state); diff --git a/es6-babel-react-flux-karma/test/stores/GreetingStore.tests.ts b/es6-babel-react-flux-karma/test/stores/GreetingStore.tests.ts index cb536b9..b060710 100644 --- a/es6-babel-react-flux-karma/test/stores/GreetingStore.tests.ts +++ b/es6-babel-react-flux-karma/test/stores/GreetingStore.tests.ts @@ -1,11 +1,11 @@ import GreetingStore from '../../src/stores/GreetingStore'; -import GreetingActionTypes from '../../src/constants/action-types/GreetingActionTypes'; +import { AddGreetingEvent, RemoveGreeting, NewGreetingChanged } from '../../src/actions/GreetingActions'; -const registeredCallback = GreetingStore._onDispatch.bind(GreetingStore); +const registeredCallback = GreetingStore.onDispatch.bind(GreetingStore); describe('GreetingStore', () => { beforeEach(() => { - GreetingStore._cleanState(); + GreetingStore.cleanState(); }); it('given no actions, newGreeting should be an empty string and greetings should be an empty array', () => { @@ -16,10 +16,7 @@ describe('GreetingStore', () => { }); it('given an ADD_GREETING action with a newGreeting of \'Benjamin\', the newGreeting should be an empty string and greetings should contain \'Benjamin\'', () => { - [{ - newGreeting: 'Benjamin', - type: GreetingActionTypes.ADD_GREETING, - }].forEach(registeredCallback); + [new AddGreetingEvent('Benjamin')].forEach(registeredCallback); const { greetings, newGreeting } = GreetingStore.getState(); @@ -28,13 +25,7 @@ describe('GreetingStore', () => { }); it('given an REMOVE_GREETING action with a greetingToRemove of \'Benjamin\', the state greetings should be an empty array', () => { - [{ - newGreeting: 'Benjamin', - type: GreetingActionTypes.ADD_GREETING, - }, { - greetingToRemove: 'Benjamin', - type: GreetingActionTypes.REMOVE_GREETING, - }].forEach(registeredCallback); + [new AddGreetingEvent('Benjamin'), new RemoveGreeting('Benjamin')].forEach(registeredCallback); const { greetings } = GreetingStore.getState(); @@ -43,10 +34,7 @@ describe('GreetingStore', () => { }); it('given a NEW_GREETING_CHANGED action with a newGreeting of \'Benjamin\', the state newGreeting should be \'Benjamin\'', () => { - [{ - newGreeting: 'Benjamin', - type: GreetingActionTypes.NEW_GREETING_CHANGED, - }].forEach(registeredCallback); + [new NewGreetingChanged('Benjamin')].forEach(registeredCallback); const { newGreeting } = GreetingStore.getState(); diff --git a/es6-babel-react-flux-karma/test/tsconfig.json b/es6-babel-react-flux-karma/test/tsconfig.json index 9755c70..b1aef87 100644 --- a/es6-babel-react-flux-karma/test/tsconfig.json +++ b/es6-babel-react-flux-karma/test/tsconfig.json @@ -8,25 +8,22 @@ "jsx": "preserve", "target": "es6", "module": "commonjs", - "noImplicitAny": false, - "suppressImplicitAnyIndexErrors": true, - "removeComments": false, + "noImplicitAny": true, "preserveConstEnums": true, "sourceMap": true }, "files": [ - "components/App.tests.tsx", - "components/Greeting.tests.tsx", - "components/WhoToGreet.tests.tsx", - "stores/GreetingStore.tests.ts", + "../typings/browser/ambient/react/index.d.ts", + "../typings/browser/ambient/react-dom/index.d.ts", + "../typings/browser/ambient/react-addons-test-utils/index.d.ts", "../typings/browser/ambient/flux/index.d.ts", "../typings/browser/ambient/jasmine/index.d.ts", "../typings/browser/ambient/node/index.d.ts", - "../typings/browser/ambient/react-addons-test-utils/index.d.ts", - "../typings/browser/ambient/react-dom/index.d.ts", - "../typings/browser/ambient/react/index.d.ts" + "components/App.tests.tsx", + "components/Greeting.tests.tsx", + "components/WhoToGreet.tests.tsx", + "stores/GreetingStore.tests.ts" ], - "exclude": [], "atom": { "rewriteTsconfig": true } From 6ef3a68535471a54ebf83cb43a7a61d82292f831 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 28 Mar 2016 13:46:34 -0700 Subject: [PATCH 25/63] Removed other directory. --- react-with-type-safe-flux/.gitignore | 201 ------------------ react-with-type-safe-flux/LICENSE | 22 -- react-with-type-safe-flux/README.md | 49 ----- react-with-type-safe-flux/gulp/.eslintrc | 73 ------- react-with-type-safe-flux/gulp/clean.js | 29 --- react-with-type-safe-flux/gulp/inject.js | 55 ----- react-with-type-safe-flux/gulp/staticFiles.js | 31 --- react-with-type-safe-flux/gulp/tests.js | 26 --- react-with-type-safe-flux/gulp/webpack.js | 91 -------- react-with-type-safe-flux/gulpFile.js | 66 ------ react-with-type-safe-flux/karma.conf.js | 68 ------ react-with-type-safe-flux/package.json | 77 ------- .../src/actions/GreetingActions.ts | 18 -- .../src/components/App.tsx | 44 ---- .../src/components/Greeting.tsx | 36 ---- .../src/components/WhoToGreet.tsx | 52 ----- .../action-types/GreetingActionTypes.ts | 7 - .../src/dispatcher/AppDispatcher.ts | 11 - react-with-type-safe-flux/src/index.html | 19 -- react-with-type-safe-flux/src/main.tsx | 6 - .../src/stores/FluxStore.ts | 57 ----- .../src/stores/GreetingStore.ts | 37 ---- react-with-type-safe-flux/src/tsconfig.json | 38 ---- .../src/types/GreetingState.ts | 6 - .../test/components/App.tests.tsx | 31 --- .../test/components/Greeting.tests.tsx | 44 ---- .../test/components/WhoToGreet.tests.tsx | 67 ------ .../test/import-babel-polyfill.js | 1 - .../test/stores/GreetingStore.tests.ts | 45 ---- react-with-type-safe-flux/test/tsconfig.json | 34 --- react-with-type-safe-flux/tsd.json | 27 --- react-with-type-safe-flux/webpack.config.js | 42 ---- 32 files changed, 1410 deletions(-) delete mode 100644 react-with-type-safe-flux/.gitignore delete mode 100644 react-with-type-safe-flux/LICENSE delete mode 100644 react-with-type-safe-flux/README.md delete mode 100644 react-with-type-safe-flux/gulp/.eslintrc delete mode 100644 react-with-type-safe-flux/gulp/clean.js delete mode 100644 react-with-type-safe-flux/gulp/inject.js delete mode 100644 react-with-type-safe-flux/gulp/staticFiles.js delete mode 100644 react-with-type-safe-flux/gulp/tests.js delete mode 100644 react-with-type-safe-flux/gulp/webpack.js delete mode 100644 react-with-type-safe-flux/gulpFile.js delete mode 100644 react-with-type-safe-flux/karma.conf.js delete mode 100644 react-with-type-safe-flux/package.json delete mode 100644 react-with-type-safe-flux/src/actions/GreetingActions.ts delete mode 100644 react-with-type-safe-flux/src/components/App.tsx delete mode 100644 react-with-type-safe-flux/src/components/Greeting.tsx delete mode 100644 react-with-type-safe-flux/src/components/WhoToGreet.tsx delete mode 100644 react-with-type-safe-flux/src/constants/action-types/GreetingActionTypes.ts delete mode 100644 react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts delete mode 100644 react-with-type-safe-flux/src/index.html delete mode 100644 react-with-type-safe-flux/src/main.tsx delete mode 100644 react-with-type-safe-flux/src/stores/FluxStore.ts delete mode 100644 react-with-type-safe-flux/src/stores/GreetingStore.ts delete mode 100644 react-with-type-safe-flux/src/tsconfig.json delete mode 100644 react-with-type-safe-flux/src/types/GreetingState.ts delete mode 100644 react-with-type-safe-flux/test/components/App.tests.tsx delete mode 100644 react-with-type-safe-flux/test/components/Greeting.tests.tsx delete mode 100644 react-with-type-safe-flux/test/components/WhoToGreet.tests.tsx delete mode 100644 react-with-type-safe-flux/test/import-babel-polyfill.js delete mode 100644 react-with-type-safe-flux/test/stores/GreetingStore.tests.ts delete mode 100644 react-with-type-safe-flux/test/tsconfig.json delete mode 100644 react-with-type-safe-flux/tsd.json delete mode 100644 react-with-type-safe-flux/webpack.config.js diff --git a/react-with-type-safe-flux/.gitignore b/react-with-type-safe-flux/.gitignore deleted file mode 100644 index a983022..0000000 --- a/react-with-type-safe-flux/.gitignore +++ /dev/null @@ -1,201 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -[Bb]in/ -[Oo]bj/ -dist/ - -# Visual Studo 2015 cache/options directory -.vs/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# JUnit test results -test-results - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding addin-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Windows Azure Build Output -csx/ -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -*.[Cc]ache -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -bower_components/ -typings/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt diff --git a/react-with-type-safe-flux/LICENSE b/react-with-type-safe-flux/LICENSE deleted file mode 100644 index 12a65bc..0000000 --- a/react-with-type-safe-flux/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 John Reilly - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/react-with-type-safe-flux/README.md b/react-with-type-safe-flux/README.md deleted file mode 100644 index 985bf13..0000000 --- a/react-with-type-safe-flux/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Type-Safe Flux Example - -Based on [ES6 + TypeScript + Babel + React + Karma: The Secret Recipe](../es6-babel-react-flux-karma), see more in corresponding [blog post](https://sameroom.io/blog/type-safe-flux-architecture-using-typescript/). - -## Getting started - -You'll need [node / npm](https://nodejs.org/) installed. To get up and running just enter: - -``` -npm install -npm run tsd install -npm run serve -``` - -This will: - -1. Download the npm packages you need -2. Download the typings from DefinitelyTyped that you need. -3. Compile the code and serve it up at [http://localhost:8080](http://localhost:8080) - -Now you need dev tools. There's a world of choice out there; there's [Atom](https://atom.io/), there's [VS Code](https://www.visualstudio.com/en-us/products/code-vs.aspx), there's [Sublime](http://www.sublimetext.com/). There's even something called [Visual Studio](http://www.visualstudio.com). It's all your choice really. - -For myself I've been using Atom combined with the mighty [atom-typescript package](https://atom.io/packages/atom-typescript). I advise you to give it a go. You won't look back. - -## I want to have an ASP.Net project and use Visual Studio + IIS Express to serve this instead - -If you drop this code into an empty Visual Studio ASP.Net project should should be good to go. You'll need this section in your `web.config` to ensure Visual Studio serves from the `dist` directory: - -``` - - - - - - - - - - - - -``` - -And rather than running `npm run serve` you'll want to use `npm run watch`. (This builds / watches your code / runs tests etc but does **not** spin up a web server.) - -Finally you'll want to set the following TypeScript options for your project - -- ECMAScript Version: ECMAScript 6 -- JSX compilation in TSX files: Preserve diff --git a/react-with-type-safe-flux/gulp/.eslintrc b/react-with-type-safe-flux/gulp/.eslintrc deleted file mode 100644 index e91bbce..0000000 --- a/react-with-type-safe-flux/gulp/.eslintrc +++ /dev/null @@ -1,73 +0,0 @@ -{ - "root": true, - "env": { - "commonjs": true, - }, - "rules": { - "camelcase": 2, - "comma-spacing": 1, - "consistent-return": 2, - "curly": [ 2, "all" ], - "dot-notation": [ - 2, - { "allowKeywords": true } - ], - "eol-last": 2, - "eqeqeq": 2, - "keyword-spacing": 2, - "new-cap": 2, - "new-parens": 2, - "no-alert": 2, - "no-array-constructor": 2, - "no-caller": 2, - "no-catch-shadow": 2, - "no-eval": 2, - "no-extend-native": 2, - "no-extra-bind": 2, - "no-extra-parens": [ 2, "functions" ], - "no-implied-eval": 2, - "no-iterator": 2, - "no-labels": 2, - "no-label-var": 2, - "no-lone-blocks": 2, - "no-loop-func": 2, - "no-multi-str": 2, - "no-native-reassign": 2, - "no-new": 2, - "no-new-func": 2, - "no-new-object": 2, - "no-new-wrappers": 2, - "no-octal-escape": 2, - "no-proto": 2, - "no-return-assign": 2, - "no-script-url": 2, - "no-sequences": 2, - "no-shadow": 2, - "no-shadow-restricted-names": 2, - "no-spaced-func": 2, - "no-trailing-spaces": 1, - "no-undef-init": 2, - "no-unused-expressions": 2, - "no-use-before-define": [ 2, "nofunc" ], - "no-with": 2, - "quotes": [ 1, "single" ], - "semi": 2, - "semi-spacing": [ - 2, - { - "before": false, - "after": true - } - ], - "space-infix-ops": 2, - "space-unary-ops": [ - 2, - { - "words": true, - "nonwords": false - } - ], - "strict": [ 2, "global" ], - "yoda": [ 2, "never" ] - } -} diff --git a/react-with-type-safe-flux/gulp/clean.js b/react-with-type-safe-flux/gulp/clean.js deleted file mode 100644 index c51b4e4..0000000 --- a/react-with-type-safe-flux/gulp/clean.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var del = require('del'); -var gutil = require('gulp-util'); -var fs = require('fs'); - -function run(done) { - fs.stat('./dist', function(err){ - if (err) { - // Never existed - done(); - } - else { - del(['./dist'], { force: true }) - .then(function(paths) { - gutil.log('Deleted files/folders:\n', paths.join('\n')); - done(); - }) - .catch(function(error) { - gutil.log('Problem deleting:\n', error); - done(); - }); - } - }); -} - -module.exports = { - run: function(done) { return run(done); } -}; diff --git a/react-with-type-safe-flux/gulp/inject.js b/react-with-type-safe-flux/gulp/inject.js deleted file mode 100644 index e4133e5..0000000 --- a/react-with-type-safe-flux/gulp/inject.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var inject = require('gulp-inject'); -var glob = require('glob'); - -function injectIndex(options) { - function run() { - var target = gulp.src('./src/index.html'); - var sources = gulp.src([ - //'./dist/styles/main*.css', - './dist/scripts/vendor*.js', - './dist/scripts/main*.js' - ], { read: false }); - - return target - .pipe(inject(sources, { ignorePath: '/dist/', addRootSlash: false, removeTags: true })) - .pipe(gulp.dest('./dist')); - } - - var jsCssGlob = 'dist/**/*.{js,css}'; - - function checkForInitialFilesThenRun() { - glob(jsCssGlob, function (er, files) { - var filesWeNeed = ['dist/scripts/main', 'dist/scripts/vendor'/*, 'dist/styles/main'*/]; - - function fileIsPresent(fileWeNeed) { - return files.some(function(file) { - return file.indexOf(fileWeNeed) !== -1; - }); - } - - if (filesWeNeed.every(fileIsPresent)) { - run('initial build'); - } else { - checkForInitialFilesThenRun(); - } - }); - } - - checkForInitialFilesThenRun(); - - if (options.shouldWatch) { - gulp.watch(jsCssGlob, function(evt) { - if (evt.path && evt.type === 'changed') { - run(evt.path); - } - }); - } -} - -module.exports = { - build: function() { return injectIndex({ shouldWatch: false }); }, - watch: function() { return injectIndex({ shouldWatch: true }); } -}; diff --git a/react-with-type-safe-flux/gulp/staticFiles.js b/react-with-type-safe-flux/gulp/staticFiles.js deleted file mode 100644 index 20327f2..0000000 --- a/react-with-type-safe-flux/gulp/staticFiles.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var cache = require('gulp-cached'); - -var targets = [ - { description: 'INDEX', src: './src/index.html', dest: './dist' } -]; - -function copy(options) { - function run(target) { - gulp.src(target.src) - .pipe(cache(target.description)) - .pipe(gulp.dest(target.dest)); - } - - function watch(target) { - gulp.watch(target.src, function() { run(target); }); - } - - targets.forEach(run); - - if (options.shouldWatch) { - targets.forEach(watch); - } -} - -module.exports = { - build: function() { return copy({ shouldWatch: false }); }, - watch: function() { return copy({ shouldWatch: true }); } -}; diff --git a/react-with-type-safe-flux/gulp/tests.js b/react-with-type-safe-flux/gulp/tests.js deleted file mode 100644 index 4d6ba04..0000000 --- a/react-with-type-safe-flux/gulp/tests.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -var Server = require('karma').Server; -var path = require('path'); -var gutil = require('gulp-util'); - -module.exports = { - watch: function() { - // Documentation: https://karma-runner.github.io/0.13/dev/public-api.html - var karmaConfig = { - configFile: path.join(__dirname, '../karma.conf.js'), - singleRun: false, - - // Fancy runner - plugins: ['karma-webpack', 'karma-jasmine', 'karma-mocha-reporter', /*'karma-junit-reporter', 'karma-coverage', */'karma-sourcemap-loader', 'karma-phantomjs-launcher'], - reporters: ['mocha'] - }; - - new Server(karmaConfig, karmaCompleted).start(); - - function karmaCompleted(exitCode) { - gutil.log('Karma has exited with:', exitCode); - process.exit(exitCode); - } - } -}; diff --git a/react-with-type-safe-flux/gulp/webpack.js b/react-with-type-safe-flux/gulp/webpack.js deleted file mode 100644 index 37c4ded..0000000 --- a/react-with-type-safe-flux/gulp/webpack.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var gutil = require('gulp-util'); -var webpack = require('webpack'); -var WebpackNotifierPlugin = require('webpack-notifier'); -var webpackConfig = require('../webpack.config.js'); - -function buildProduction(done) { - // modify some webpack config options - var myProdConfig = Object.create(webpackConfig); - myProdConfig.output.filename = '[name].[hash].js'; - - myProdConfig.plugins = myProdConfig.plugins.concat( - new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.[hash].js' }), - new webpack.optimize.DedupePlugin(), - new webpack.optimize.UglifyJsPlugin() - ); - - // run webpack - webpack(myProdConfig, function(err, stats) { - if(err) { throw new gutil.PluginError('webpack:build', err); } - gutil.log('[webpack:build]', stats.toString({ - colors: true - })); - - if (done) { done(); } - }); -} - -function createDevCompiler() { - // modify some webpack config options - var myDevConfig = Object.create(webpackConfig); - myDevConfig.devtool = 'inline-source-map'; - myDevConfig.debug = true; - - myDevConfig.plugins = myDevConfig.plugins.concat( - new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.js' }), - new WebpackNotifierPlugin({ title: 'Webpack build', excludeWarnings: true }) - ); - - // create a single instance of the compiler to allow caching - return webpack(myDevConfig); -} - -function buildDevelopment(done, devCompiler) { - // run webpack - devCompiler.run(function(err, stats) { - if(err) { throw new gutil.PluginError('webpack:build-dev', err); } - gutil.log('[webpack:build-dev]', stats.toString({ - chunks: false, - colors: true - })); - - if (done) { done(); } - }); -} - - -function bundle(options) { - var devCompiler; - - function build(done) { - if (options.shouldWatch) { - buildDevelopment(done, devCompiler); - } else { - buildProduction(done); - } - } - - if (options.shouldWatch) { - devCompiler = createDevCompiler(); - - gulp.watch('src/**/*', function() { build(); }); - } - - return new Promise(function(resolve, reject) { - build(function (err) { - if (err) { - reject(err); - } else { - resolve('webpack built'); - } - }); - }); -} - -module.exports = { - build: function() { return bundle({ shouldWatch: false }); }, - watch: function() { return bundle({ shouldWatch: true }); } -}; diff --git a/react-with-type-safe-flux/gulpFile.js b/react-with-type-safe-flux/gulpFile.js deleted file mode 100644 index b7b3abe..0000000 --- a/react-with-type-safe-flux/gulpFile.js +++ /dev/null @@ -1,66 +0,0 @@ -/* eslint-disable no-var, strict, prefer-arrow-callback */ -'use strict'; - -var gulp = require('gulp'); -var gutil = require('gulp-util'); -var eslint = require('gulp-eslint'); -var webpack = require('./gulp/webpack'); -var staticFiles = require('./gulp/staticFiles'); -var tests = require('./gulp/tests'); -var clean = require('./gulp/clean'); -var inject = require('./gulp/inject'); - -var lintSrcs = ['./gulp/**/*.js']; - -gulp.task('delete-dist', function (done) { - clean.run(done); -}); - -gulp.task('build-process.env.NODE_ENV', function () { - process.env.NODE_ENV = 'production'; -}); - -gulp.task('build-js', ['delete-dist', 'build-process.env.NODE_ENV'], function(done) { - webpack.build().then(function() { done(); }); -}); - -gulp.task('build-other', ['delete-dist', 'build-process.env.NODE_ENV'], function() { - staticFiles.build(); -}); - -gulp.task('build', ['build-js', 'build-other', 'lint'], function () { - inject.build(); -}); - -gulp.task('lint', function () { - return gulp.src(lintSrcs) - .pipe(eslint()) - .pipe(eslint.format()); -}); - -gulp.task('watch', ['delete-dist'], function(done) { - process.env.NODE_ENV = 'development'; - Promise.all([ - webpack.watch()//, - //less.watch() - ]).then(function() { - gutil.log('Now that initial assets (js and css) are generated inject will start...'); - inject.watch(); - done(); - }).catch(function(error) { - gutil.log('Problem generating initial assets (js and css)', error); - }); - - gulp.watch(lintSrcs, ['lint']); - staticFiles.watch(); - tests.watch(); -}); - -gulp.task('watch-and-serve', ['watch'], function() { - // local as not required for build - var express = require('express') - var app = express() - - app.use(express.static('dist', {'index': 'index.html'})) - app.listen(8080); -}); diff --git a/react-with-type-safe-flux/karma.conf.js b/react-with-type-safe-flux/karma.conf.js deleted file mode 100644 index 10ffba7..0000000 --- a/react-with-type-safe-flux/karma.conf.js +++ /dev/null @@ -1,68 +0,0 @@ -/* eslint-disable no-var, strict */ -'use strict'; - -var webpackConfig = require('./webpack.config.js'); - -module.exports = function(config) { - // Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html - config.set({ - browsers: [ 'PhantomJS' ], - - files: [ - 'test/import-babel-polyfill.js', // This ensures we have the es6 shims in place from babel - 'test/**/*.tests.ts', - 'test/**/*.tests.tsx' - ], - - port: 9876, - - frameworks: [ 'jasmine' ], - - logLevel: config.LOG_INFO, //config.LOG_DEBUG - - preprocessors: { - 'test/import-babel-polyfill.js': [ 'webpack', 'sourcemap' ], - 'src/**/*.{ts,tsx}': [ 'webpack', 'sourcemap' ], - 'test/**/*.tests.{ts,tsx}': [ 'webpack', 'sourcemap' ] - }, - - webpack: { - devtool: 'eval-source-map', //'inline-source-map', - debug: true, - module: webpackConfig.module, - resolve: webpackConfig.resolve - }, - - webpackMiddleware: { - quiet: true, - stats: { - colors: true - } - }, - - // reporter options - mochaReporter: { - colors: { - success: 'bgGreen', - info: 'cyan', - warning: 'bgBlue', - error: 'bgRed' - } - }, - - // the default configuration - junitReporter: { - outputDir: 'test-results', // results will be saved as $outputDir/$browserName.xml - outputFile: undefined, // if included, results will be saved as $outputDir/$browserName/$outputFile - suite: '' - }, - - coverageReporter: { - reporters:[ - //{type: 'html', dir:'coverage/'}, // https://github.com/karma-runner/karma-coverage/issues/123 - {type: 'text'}, - {type: 'text-summary'} - ], - } - }); -}; diff --git a/react-with-type-safe-flux/package.json b/react-with-type-safe-flux/package.json deleted file mode 100644 index 74ed7af..0000000 --- a/react-with-type-safe-flux/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "es6-babel-react-flux-karma", - "version": "1.0.0", - "description": "ES6 + TypeScript + Babel + React + Karma: The Secret Recipe", - "main": "index.js", - "scripts": { - "tsd": "tsd", - "test": "karma start --reporters mocha,junit --single-run --browsers PhantomJS", - "serve": "gulp watch-and-serve", - "watch": "gulp watch", - "build": "gulp build" - }, - "bin": { - "tsd": "./node_modules/tsd/build/cli.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/microsoft/typescriptsamples.git" - }, - "keywords": [ - "React", - "Flux", - "ES6", - "typescript" - ], - "author": "John Reilly", - "license": "MIT", - "bugs": { - "url": "https://github.com/microsoft/typescriptsamples/issues" - }, - "homepage": "https://github.com/Microsoft/TypeScriptSamples/tree/master/es6-babel-react-flux-karma#readme", - "devDependencies": { - "babel": "^6.0.0", - "babel-core": "^6.0.0", - "babel-loader": "^6.0.0", - "babel-polyfill": "^6.0.0", - "babel-preset-es2015": "^6.0.0", - "babel-preset-react": "^6.0.0", - "del": "^2.0.2", - "eslint": "^2.0.0", - "express": "^4.13.3", - "flux": "^2.0.3", - "glob": "^7.0.0", - "gulp": "^3.9.0", - "gulp-autoprefixer": "^3.1.0", - "gulp-cached": "^1.1.0", - "gulp-cssmin": "^0.1.7", - "gulp-eslint": "^2.0.0", - "gulp-if": "^2.0.0", - "gulp-inject": "^3.0.0", - "gulp-notify": "^2.2.0", - "gulp-sourcemaps": "^1.5.2", - "gulp-streamify": "1.0.2", - "gulp-uglify": "^1.2.0", - "gulp-util": "^3.0.6", - "jasmine-core": "^2.3.4", - "karma": "^0.13.10", - "karma-coverage": "^0.5.2", - "karma-jasmine": "^0.3.6", - "karma-junit-reporter": "^0.3.7", - "karma-mocha-reporter": "^1.1.1", - "karma-phantomjs-launcher": "^1.0.0", - "karma-phantomjs-shim": "^1.1.1", - "karma-sourcemap-loader": "^0.3.6", - "karma-webpack": "^1.7.0", - "phantomjs": "^2.1.3", - "phantomjs-prebuilt": "^2.1.4", - "react": "^0.14.3", - "react-addons-test-utils": "^0.14.3", - "react-dom": "^0.14.3", - "ts-loader": "^0.8.1", - "tsd": "^0.6.5", - "typescript": "^1.8.0", - "webpack": "^1.12.2", - "webpack-notifier": "^1.2.1" - } -} diff --git a/react-with-type-safe-flux/src/actions/GreetingActions.ts b/react-with-type-safe-flux/src/actions/GreetingActions.ts deleted file mode 100644 index a4cfc7e..0000000 --- a/react-with-type-safe-flux/src/actions/GreetingActions.ts +++ /dev/null @@ -1,18 +0,0 @@ -import {TypedEvent, AppDispatcher} from '../dispatcher/AppDispatcher'; -import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; - -export class AddGreetingEvent extends TypedEvent {} -export class NewGreetingChanged extends TypedEvent {} -export class RemoveGreeting extends TypedEvent {} - -export function addGreeting(newGreeting: string) { - AppDispatcher.dispatch(new AddGreetingEvent(newGreeting)); -} - -export function newGreetingChanged(newGreeting: string) { - AppDispatcher.dispatch(new NewGreetingChanged(newGreeting)); -} - -export function removeGreeting(greetingToRemove: string) { - AppDispatcher.dispatch(new RemoveGreeting(greetingToRemove)); -} diff --git a/react-with-type-safe-flux/src/components/App.tsx b/react-with-type-safe-flux/src/components/App.tsx deleted file mode 100644 index 7146ac7..0000000 --- a/react-with-type-safe-flux/src/components/App.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import * as React from 'react'; -import GreetingStore from '../stores/GreetingStore'; -import * as GreetingActions from '../actions/GreetingActions'; -import GreetingState from '../types/GreetingState'; -import WhoToGreet from './WhoToGreet'; -import Greeting from './Greeting'; - -class App extends React.Component<{}, GreetingState> { - constructor(props: {}) { - super(props); - this.state = this._getStateFromStores(); - } - - componentWillMount() { - GreetingStore.addChangeListener(this._onChange); - } - - componentWillUnmount() { - GreetingStore.removeChangeListener(this._onChange); - } - - render() { - const { greetings, newGreeting } = this.state; - return ( -

-

Hello People!

- - - - { greetings.map((g, index) => ) } -
- ); - } - - _onChange = () => { - this.setState(this._getStateFromStores()); - } - - _getStateFromStores() { - return GreetingStore.getState(); - } -} - -export default App; diff --git a/react-with-type-safe-flux/src/components/Greeting.tsx b/react-with-type-safe-flux/src/components/Greeting.tsx deleted file mode 100644 index 7d1502b..0000000 --- a/react-with-type-safe-flux/src/components/Greeting.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import * as React from 'react'; -import * as GreetingActions from '../actions/GreetingActions'; - -interface Props { - key: number; - targetOfGreeting: string; -} - -class Greeting extends React.Component { - constructor(props: Props) { - super(props); - } - - static propTypes: React.ValidationMap = { - targetOfGreeting: React.PropTypes.string.isRequired - } - - render() { - return ( -

- Hello { this.props.targetOfGreeting }! - - -

- ); - } - - _onClick = (event: React.MouseEvent) => { - GreetingActions.removeGreeting(this.props.targetOfGreeting); - } -} - -export default Greeting; diff --git a/react-with-type-safe-flux/src/components/WhoToGreet.tsx b/react-with-type-safe-flux/src/components/WhoToGreet.tsx deleted file mode 100644 index 6712746..0000000 --- a/react-with-type-safe-flux/src/components/WhoToGreet.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import * as React from 'react'; -import * as GreetingActions from '../actions/GreetingActions'; - -interface Props { - newGreeting: string; -} - -class WhoToGreet extends React.Component { - constructor(props: Props) { - super(props); - } - - static propTypes: React.ValidationMap = { - newGreeting: React.PropTypes.string.isRequired - } - - render() { - return ( -
-
- - -
-
- ); - } - - get _preventSubmission() { - return !this.props.newGreeting; - } - - _handleNewGreetingChange = (event: React.FormEvent) => { - const newGreeting = (event.target as HTMLInputElement).value; - GreetingActions.newGreetingChanged(newGreeting); - } - - _onSubmit = (event: React.FormEvent) => { - event.preventDefault(); - - if (!this._preventSubmission) { - GreetingActions.addGreeting(this.props.newGreeting); - } - } -} - -export default WhoToGreet; diff --git a/react-with-type-safe-flux/src/constants/action-types/GreetingActionTypes.ts b/react-with-type-safe-flux/src/constants/action-types/GreetingActionTypes.ts deleted file mode 100644 index ef9fda4..0000000 --- a/react-with-type-safe-flux/src/constants/action-types/GreetingActionTypes.ts +++ /dev/null @@ -1,7 +0,0 @@ -const GreetingActionTypes = { - ADD_GREETING: 'GreetingActionTypes.ADD_GREETING', - REMOVE_GREETING: 'GreetingActionTypes.REMOVE_GREETING', - NEW_GREETING_CHANGED: 'GreetingActionTypes.NEW_GREETING_CHANGED' -}; - -export default GreetingActionTypes; diff --git a/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts b/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts deleted file mode 100644 index 9dfa556..0000000 --- a/react-with-type-safe-flux/src/dispatcher/AppDispatcher.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Dispatcher } from 'flux'; - -export class TypedEvent

{ - constructor(public payload: P) {} -} - -export type Event = TypedEvent; - -const dispatcherInstance: Flux.Dispatcher = new Dispatcher(); - -export const AppDispatcher = dispatcherInstance; diff --git a/react-with-type-safe-flux/src/index.html b/react-with-type-safe-flux/src/index.html deleted file mode 100644 index c5c150d..0000000 --- a/react-with-type-safe-flux/src/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - ES6 + Babel + React + Flux + Karma: The Secret Recipe - - - - - - -

- - - - diff --git a/react-with-type-safe-flux/src/main.tsx b/react-with-type-safe-flux/src/main.tsx deleted file mode 100644 index 1e14a73..0000000 --- a/react-with-type-safe-flux/src/main.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import 'babel-polyfill'; -import * as React from 'react'; -import * as ReactDOM from 'react-dom'; -import App from './components/App'; - -ReactDOM.render(, document.getElementById('content')); diff --git a/react-with-type-safe-flux/src/stores/FluxStore.ts b/react-with-type-safe-flux/src/stores/FluxStore.ts deleted file mode 100644 index 0aca6c4..0000000 --- a/react-with-type-safe-flux/src/stores/FluxStore.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { EventEmitter } from 'events'; -import { Event } from '../dispatcher/AppDispatcher'; - -const CHANGE_EVENT = 'change'; - -class FluxStore { - _changed: boolean; - _emitter: EventEmitter; - dispatchToken: string; - _dispatcher: Flux.Dispatcher; - _cleanStateFn: () => TState; - _state: TState; - - constructor(dispatcher: Flux.Dispatcher, protected _onDispatch: (action: Event) => void, cleanStateFn: () => TState) { - this._emitter = new EventEmitter(); - this._changed = false; - this._dispatcher = dispatcher; - this.dispatchToken = dispatcher.register((payload: Event) => { - this._invokeOnDispatch(payload); - }); - - this._cleanStateFn = cleanStateFn; - this._state = this._cleanStateFn(); - } - - /** - * Is idempotent per dispatched event - */ - emitChange() { - this._changed = true; - } - - hasChanged() { return this._changed; } - - addChangeListener(callback: () => void) { - this._emitter.on(CHANGE_EVENT, callback); - } - - removeChangeListener(callback: () => void) { - this._emitter.removeListener(CHANGE_EVENT, callback); - } - - _cleanState() { - this._changed = false; - this._state = this._cleanStateFn(); - } - - _invokeOnDispatch(payload: Event) { - this._changed = false; - this._onDispatch(payload); - if (this._changed) { - this._emitter.emit(CHANGE_EVENT); - } - } -} - -export default FluxStore; diff --git a/react-with-type-safe-flux/src/stores/GreetingStore.ts b/react-with-type-safe-flux/src/stores/GreetingStore.ts deleted file mode 100644 index 08840b9..0000000 --- a/react-with-type-safe-flux/src/stores/GreetingStore.ts +++ /dev/null @@ -1,37 +0,0 @@ -import FluxStore from './FluxStore'; -import GreetingActionTypes from '../constants/action-types/GreetingActionTypes'; -import {Event, AppDispatcher} from '../dispatcher/AppDispatcher'; -import GreetingState from '../types/GreetingState'; -import { AddGreetingEvent, RemoveGreeting, NewGreetingChanged } from '../actions/GreetingActions'; - -class GreeterStore extends FluxStore { - constructor(dispatcher: Flux.Dispatcher) { - const onDispatch = (action: Event) => { - if (action instanceof AddGreetingEvent) { - const {payload} = action; - this._state.newGreeting = ''; - this._state.greetings = this._state.greetings.concat(payload); - this.emitChange(); - } else if (action instanceof RemoveGreeting) { - const {payload} = action; - this._state.greetings = this._state.greetings.filter(g => g !== payload); - this.emitChange(); - } else if (action instanceof NewGreetingChanged) { - const {payload} = action; - this._state.newGreeting = payload; - this.emitChange(); - } - } - super(dispatcher, onDispatch, () => ({ - greetings: [], - newGreeting: '' - })); - } - - getState() { - return this._state - } -} - -const greeterStoreInstance = new GreeterStore(AppDispatcher); -export default greeterStoreInstance; diff --git a/react-with-type-safe-flux/src/tsconfig.json b/react-with-type-safe-flux/src/tsconfig.json deleted file mode 100644 index f116b8b..0000000 --- a/react-with-type-safe-flux/src/tsconfig.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "compileOnSave": false, - "filesGlob": [ - "../typings/**/*.*.ts", - "!../typings/jasmine/jasmine.d.ts", - "!../typings/react/react-addons-test-utils.d.ts", - "**/*.{ts,tsx}" - ], - "compilerOptions": { - "jsx": "preserve", - "target": "es6", - "noImplicitAny": true, - "removeComments": false, - "preserveConstEnums": true, - "sourceMap": true - }, - "files": [ - "../typings/flux/flux.d.ts", - "../typings/node/node.d.ts", - "../typings/react/react-dom.d.ts", - "../typings/react/react.d.ts", - "../typings/tsd.d.ts", - "actions/GreetingActions.ts", - "components/App.tsx", - "components/Greeting.tsx", - "components/WhoToGreet.tsx", - "constants/action-types/GreetingActionTypes.ts", - "dispatcher/AppDispatcher.ts", - "main.tsx", - "stores/FluxStore.ts", - "stores/GreetingStore.ts", - "types/GreetingState.ts" - ], - "exclude": [], - "atom": { - "rewriteTsconfig": true - } -} diff --git a/react-with-type-safe-flux/src/types/GreetingState.ts b/react-with-type-safe-flux/src/types/GreetingState.ts deleted file mode 100644 index 656b201..0000000 --- a/react-with-type-safe-flux/src/types/GreetingState.ts +++ /dev/null @@ -1,6 +0,0 @@ -interface GreetingState { - greetings: string[]; - newGreeting: string; -} - -export default GreetingState; diff --git a/react-with-type-safe-flux/test/components/App.tests.tsx b/react-with-type-safe-flux/test/components/App.tests.tsx deleted file mode 100644 index 1530e64..0000000 --- a/react-with-type-safe-flux/test/components/App.tests.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import * as React from 'react'; -import * as TestUtils from 'react-addons-test-utils'; -import App from '../../src/components/App'; -import WhoToGreet from '../../src/components/WhoToGreet'; -import Greeting from '../../src/components/Greeting'; -import GreetingStore from '../../src/stores/GreetingStore'; - -describe('App', () => { - it('renders expected HTML', () => { - const app = render({ greetings: ['James'], newGreeting: 'Benjamin' }); - expect(app).toEqual( -
-

Hello People!

- - - - { [ - - ] } -
- ); - }); - - function render(state) { - const shallowRenderer = TestUtils.createRenderer(); - spyOn(GreetingStore, 'getState').and.returnValue(state); - - shallowRenderer.render(); - return shallowRenderer.getRenderOutput(); - } -}); diff --git a/react-with-type-safe-flux/test/components/Greeting.tests.tsx b/react-with-type-safe-flux/test/components/Greeting.tests.tsx deleted file mode 100644 index 9ea44b4..0000000 --- a/react-with-type-safe-flux/test/components/Greeting.tests.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import * as React from 'react'; -import * as TestUtils from 'react-addons-test-utils'; -import Greeting from '../../src/components/Greeting'; -import * as GreetingActions from '../../src/actions/GreetingActions'; - -describe('Greeting', () => { - let handleSelectionChangeSpy: jasmine.Spy; - beforeEach(() => { - handleSelectionChangeSpy = jasmine.createSpy('handleSelectionChange'); - }); - - it('given a targetOfGreeting of \'James\' it renders a p containing a greeting and a remove button', () => { - const targetOfGreeting = 'James'; - - const p = render({ targetOfGreeting }); - expect(p.type).toBe('p'); - expect(p.props.children[0]).toBe('Hello '); - expect(p.props.children[1]).toBe('James'); - expect(p.props.children[2]).toBe('!'); - - const [ , , , button ] = p.props.children; - - expect(button.type).toBe('button'); - expect(button.props.className).toBe('btn btn-default btn-danger'); - expect(button.props.children).toBe('Remove'); - }); - - it('button onClick triggers an removeGreeting action', () => { - const targetOfGreeting = 'Benjamin'; - const p = render({ targetOfGreeting }); - const [ , , , button ] = p.props.children; - spyOn(GreetingActions, 'removeGreeting'); - - button.props.onClick(); - - expect(GreetingActions.removeGreeting).toHaveBeenCalledWith(targetOfGreeting); - }); - - function render({ targetOfGreeting }) { - const shallowRenderer = TestUtils.createRenderer(); - shallowRenderer.render(); - return shallowRenderer.getRenderOutput(); - } -}); diff --git a/react-with-type-safe-flux/test/components/WhoToGreet.tests.tsx b/react-with-type-safe-flux/test/components/WhoToGreet.tests.tsx deleted file mode 100644 index e514ec3..0000000 --- a/react-with-type-safe-flux/test/components/WhoToGreet.tests.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import * as React from 'react'; -import * as TestUtils from 'react-addons-test-utils'; -import WhoToGreet from '../../src/components/WhoToGreet'; -import * as GreetingActions from '../../src/actions/GreetingActions'; - -describe('WhoToGreet', () => { - let handleSelectionChangeSpy: jasmine.Spy; - beforeEach(() => { - handleSelectionChangeSpy = jasmine.createSpy('handleSelectionChange'); - }); - - it('given a newGreeting then it renders a form containing an input containing that text and an add button', () => { - const newGreeting = 'James'; - - const form = render({ newGreeting }); - expect(form.type).toBe('form'); - expect(form.props.role).toBe('form'); - - const formGroup = form.props.children; - expect(formGroup.type).toBe('div'); - expect(formGroup.props.className).toBe('form-group'); - - const [ input, button ] = formGroup.props.children; - - expect(input.type).toBe('input'); - expect(input.props.type).toBe('text'); - expect(input.props.className).toBe('form-control'); - expect(input.props.placeholder).toBe('Who would you like to greet?'); - expect(input.props.value).toBe(newGreeting); - - expect(button.type).toBe('button'); - expect(button.props.type).toBe('submit'); - expect(button.props.className).toBe('btn btn-default btn-primary'); - expect(button.props.disabled).toBe(false); - expect(button.props.children).toBe('Add greeting'); - }); - - it('input onChange triggers a newGreetingChanged action', () => { - const newGreeting = 'Benjamin'; - const form = render({ newGreeting }); - const formGroup = form.props.children; - const [ input ] = formGroup.props.children; - spyOn(GreetingActions, 'newGreetingChanged'); - - input.props.onChange({ target: { value: newGreeting }}); - - expect(GreetingActions.newGreetingChanged).toHaveBeenCalledWith(newGreeting); - }); - - it('button onClick triggers an addGreeting action', () => { - const newGreeting = 'Benjamin'; - const form = render({ newGreeting }); - const formGroup = form.props.children; - const [ , button ] = formGroup.props.children; - spyOn(GreetingActions, 'addGreeting'); - - button.props.onClick({ preventDefault: () => {} }); - - expect(GreetingActions.addGreeting).toHaveBeenCalledWith(newGreeting); - }); - - function render({ newGreeting }) { - const shallowRenderer = TestUtils.createRenderer(); - shallowRenderer.render(); - return shallowRenderer.getRenderOutput(); - } -}); diff --git a/react-with-type-safe-flux/test/import-babel-polyfill.js b/react-with-type-safe-flux/test/import-babel-polyfill.js deleted file mode 100644 index b012711..0000000 --- a/react-with-type-safe-flux/test/import-babel-polyfill.js +++ /dev/null @@ -1 +0,0 @@ -import 'babel-polyfill'; diff --git a/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts b/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts deleted file mode 100644 index f617a0d..0000000 --- a/react-with-type-safe-flux/test/stores/GreetingStore.tests.ts +++ /dev/null @@ -1,45 +0,0 @@ -import GreetingStore from '../../src/stores/GreetingStore'; -import GreetingActionTypes from '../../src/constants/action-types/GreetingActionTypes'; -import { AddGreetingEvent, RemoveGreeting, NewGreetingChanged } from '../../src/actions/GreetingActions'; - -const registeredCallback = GreetingStore._onDispatch.bind(GreetingStore); - -describe('GreetingStore', () => { - beforeEach(() => { - GreetingStore._cleanState(); - }); - - it('given no actions, newGreeting should be an empty string and greetings should be an empty array', () => { - const { greetings, newGreeting } = GreetingStore.getState(); - - expect(greetings).toEqual([]); - expect(newGreeting).toBe(''); - }); - - it('given an ADD_GREETING action with a newGreeting of \'Benjamin\', the newGreeting should be an empty string and greetings should contain \'Benjamin\'', () => { - [new AddGreetingEvent('Benjamin')].forEach(registeredCallback); - - const { greetings, newGreeting } = GreetingStore.getState(); - - expect(greetings.find(g => g === 'Benjamin')).toBeTruthy(); - expect(newGreeting).toBe(''); - }); - - it('given an REMOVE_GREETING action with a greetingToRemove of \'Benjamin\', the state greetings should be an empty array', () => { - [new AddGreetingEvent('Benjamin'), new RemoveGreeting('Benjamin')].forEach(registeredCallback); - - const { greetings } = GreetingStore.getState(); - - expect(greetings.length).toBe(0); - expect(greetings.find(g => g === 'Benjamin')).toBeFalsy(); - }); - - it('given a NEW_GREETING_CHANGED action with a newGreeting of \'Benjamin\', the state newGreeting should be \'Benjamin\'', () => { - [new NewGreetingChanged('Benjamin')].forEach(registeredCallback); - - const { newGreeting } = GreetingStore.getState(); - - expect(newGreeting).toEqual('Benjamin'); - }); - -}); diff --git a/react-with-type-safe-flux/test/tsconfig.json b/react-with-type-safe-flux/test/tsconfig.json deleted file mode 100644 index 368d9d5..0000000 --- a/react-with-type-safe-flux/test/tsconfig.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "compileOnSave": false, - "filesGlob": [ - "**/*.{ts,tsx}", - "../typings/**/*.*.ts" - ], - "compilerOptions": { - "jsx": "preserve", - "target": "es6", - "module": "commonjs", - "noImplicitAny": false, - "suppressImplicitAnyIndexErrors": true, - "removeComments": false, - "preserveConstEnums": true, - "sourceMap": true - }, - "files": [ - "components/App.tests.tsx", - "components/Greeting.tests.tsx", - "components/WhoToGreet.tests.tsx", - "stores/GreetingStore.tests.ts", - "../typings/flux/flux.d.ts", - "../typings/jasmine/jasmine.d.ts", - "../typings/node/node.d.ts", - "../typings/react/react-addons-test-utils.d.ts", - "../typings/react/react-dom.d.ts", - "../typings/react/react.d.ts", - "../typings/tsd.d.ts" - ], - "exclude": [], - "atom": { - "rewriteTsconfig": true - } -} diff --git a/react-with-type-safe-flux/tsd.json b/react-with-type-safe-flux/tsd.json deleted file mode 100644 index 2716a22..0000000 --- a/react-with-type-safe-flux/tsd.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": "v4", - "repo": "borisyankov/DefinitelyTyped", - "ref": "master", - "path": "typings", - "bundle": "typings/tsd.d.ts", - "installed": { - "jasmine/jasmine.d.ts": { - "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" - }, - "flux/flux.d.ts": { - "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" - }, - "node/node.d.ts": { - "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" - }, - "react/react.d.ts": { - "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" - }, - "react/react-dom.d.ts": { - "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" - }, - "react/react-addons-test-utils.d.ts": { - "commit": "bcd5761826eb567876c197ccc6a87c4d05731054" - } - } -} diff --git a/react-with-type-safe-flux/webpack.config.js b/react-with-type-safe-flux/webpack.config.js deleted file mode 100644 index 70d955b..0000000 --- a/react-with-type-safe-flux/webpack.config.js +++ /dev/null @@ -1,42 +0,0 @@ -/* eslint-disable no-var, strict, prefer-arrow-callback */ -'use strict'; - -var path = require('path'); - -module.exports = { - cache: true, - entry: { - main: './src/main.tsx', - vendor: [ - 'babel-polyfill', - 'events', - 'flux', - 'react' - ] - }, - output: { - path: path.resolve(__dirname, './dist/scripts'), - filename: '[name].js', - chunkFilename: '[chunkhash].js' - }, - module: { - loaders: [{ - test: /\.ts(x?)$/, - exclude: /node_modules/, - loader: 'babel-loader?presets[]=es2015&presets[]=react!ts-loader' - }, { - test: /\.js$/, - exclude: /node_modules/, - loader: 'babel', - query: { - presets: ['es2015', 'react'] - } - }] - }, - plugins: [ - ], - resolve: { - // Add `.ts` and `.tsx` as a resolvable extension. - extensions: ['', '.webpack.js', '.web.js', '.ts', '.tsx', '.js'] - }, -}; From b6ce37749adf1639e4d0a1a0699e89e5f7769209 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 28 Mar 2016 13:47:17 -0700 Subject: [PATCH 26/63] Consistency. --- es6-babel-react-flux-karma/src/stores/GreetingStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es6-babel-react-flux-karma/src/stores/GreetingStore.ts b/es6-babel-react-flux-karma/src/stores/GreetingStore.ts index 2846175..30b3251 100644 --- a/es6-babel-react-flux-karma/src/stores/GreetingStore.ts +++ b/es6-babel-react-flux-karma/src/stores/GreetingStore.ts @@ -7,7 +7,7 @@ class GreeterStore extends FluxStore { constructor(dispatcher: Flux.Dispatcher) { const onDispatch = (action: Event) => { if (action instanceof AddGreetingEvent) { - const { payload } = action; + const {payload} = action; this.state.newGreeting = ''; this.state.greetings = this.state.greetings.concat(payload); this.emitChange(); From 592ef33b0a9a115c48bf7909ae494b73cc72b8d1 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 28 Mar 2016 13:49:01 -0700 Subject: [PATCH 27/63] Renamed folder. --- {es6-babel-react-flux-karma => react-flux-babel-karma}/.gitignore | 0 {es6-babel-react-flux-karma => react-flux-babel-karma}/LICENSE | 0 {es6-babel-react-flux-karma => react-flux-babel-karma}/README.md | 0 .../gulp/.eslintrc | 0 .../gulp/clean.js | 0 .../gulp/inject.js | 0 .../gulp/staticFiles.js | 0 .../gulp/tests.js | 0 .../gulp/webpack.js | 0 .../gulpFile.js | 0 .../karma.conf.js | 0 .../package.json | 0 .../src/actions/GreetingActions.ts | 0 .../src/components/App.tsx | 0 .../src/components/Greeting.tsx | 0 .../src/components/WhoToGreet.tsx | 0 .../src/dispatcher/AppDispatcher.ts | 0 .../src/index.html | 0 .../src/main.tsx | 0 .../src/stores/FluxStore.ts | 0 .../src/stores/GreetingStore.ts | 0 .../src/tsconfig.json | 0 .../src/types/GreetingState.ts | 0 .../test/components/App.tests.tsx | 0 .../test/components/Greeting.tests.tsx | 0 .../test/components/WhoToGreet.tests.tsx | 0 .../test/import-babel-polyfill.js | 0 .../test/stores/GreetingStore.tests.ts | 0 .../test/tsconfig.json | 0 .../typings.json | 0 .../webpack.config.js | 0 31 files changed, 0 insertions(+), 0 deletions(-) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/.gitignore (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/LICENSE (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/README.md (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/gulp/.eslintrc (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/gulp/clean.js (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/gulp/inject.js (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/gulp/staticFiles.js (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/gulp/tests.js (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/gulp/webpack.js (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/gulpFile.js (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/karma.conf.js (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/package.json (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/src/actions/GreetingActions.ts (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/src/components/App.tsx (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/src/components/Greeting.tsx (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/src/components/WhoToGreet.tsx (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/src/dispatcher/AppDispatcher.ts (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/src/index.html (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/src/main.tsx (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/src/stores/FluxStore.ts (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/src/stores/GreetingStore.ts (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/src/tsconfig.json (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/src/types/GreetingState.ts (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/test/components/App.tests.tsx (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/test/components/Greeting.tests.tsx (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/test/components/WhoToGreet.tests.tsx (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/test/import-babel-polyfill.js (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/test/stores/GreetingStore.tests.ts (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/test/tsconfig.json (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/typings.json (100%) rename {es6-babel-react-flux-karma => react-flux-babel-karma}/webpack.config.js (100%) diff --git a/es6-babel-react-flux-karma/.gitignore b/react-flux-babel-karma/.gitignore similarity index 100% rename from es6-babel-react-flux-karma/.gitignore rename to react-flux-babel-karma/.gitignore diff --git a/es6-babel-react-flux-karma/LICENSE b/react-flux-babel-karma/LICENSE similarity index 100% rename from es6-babel-react-flux-karma/LICENSE rename to react-flux-babel-karma/LICENSE diff --git a/es6-babel-react-flux-karma/README.md b/react-flux-babel-karma/README.md similarity index 100% rename from es6-babel-react-flux-karma/README.md rename to react-flux-babel-karma/README.md diff --git a/es6-babel-react-flux-karma/gulp/.eslintrc b/react-flux-babel-karma/gulp/.eslintrc similarity index 100% rename from es6-babel-react-flux-karma/gulp/.eslintrc rename to react-flux-babel-karma/gulp/.eslintrc diff --git a/es6-babel-react-flux-karma/gulp/clean.js b/react-flux-babel-karma/gulp/clean.js similarity index 100% rename from es6-babel-react-flux-karma/gulp/clean.js rename to react-flux-babel-karma/gulp/clean.js diff --git a/es6-babel-react-flux-karma/gulp/inject.js b/react-flux-babel-karma/gulp/inject.js similarity index 100% rename from es6-babel-react-flux-karma/gulp/inject.js rename to react-flux-babel-karma/gulp/inject.js diff --git a/es6-babel-react-flux-karma/gulp/staticFiles.js b/react-flux-babel-karma/gulp/staticFiles.js similarity index 100% rename from es6-babel-react-flux-karma/gulp/staticFiles.js rename to react-flux-babel-karma/gulp/staticFiles.js diff --git a/es6-babel-react-flux-karma/gulp/tests.js b/react-flux-babel-karma/gulp/tests.js similarity index 100% rename from es6-babel-react-flux-karma/gulp/tests.js rename to react-flux-babel-karma/gulp/tests.js diff --git a/es6-babel-react-flux-karma/gulp/webpack.js b/react-flux-babel-karma/gulp/webpack.js similarity index 100% rename from es6-babel-react-flux-karma/gulp/webpack.js rename to react-flux-babel-karma/gulp/webpack.js diff --git a/es6-babel-react-flux-karma/gulpFile.js b/react-flux-babel-karma/gulpFile.js similarity index 100% rename from es6-babel-react-flux-karma/gulpFile.js rename to react-flux-babel-karma/gulpFile.js diff --git a/es6-babel-react-flux-karma/karma.conf.js b/react-flux-babel-karma/karma.conf.js similarity index 100% rename from es6-babel-react-flux-karma/karma.conf.js rename to react-flux-babel-karma/karma.conf.js diff --git a/es6-babel-react-flux-karma/package.json b/react-flux-babel-karma/package.json similarity index 100% rename from es6-babel-react-flux-karma/package.json rename to react-flux-babel-karma/package.json diff --git a/es6-babel-react-flux-karma/src/actions/GreetingActions.ts b/react-flux-babel-karma/src/actions/GreetingActions.ts similarity index 100% rename from es6-babel-react-flux-karma/src/actions/GreetingActions.ts rename to react-flux-babel-karma/src/actions/GreetingActions.ts diff --git a/es6-babel-react-flux-karma/src/components/App.tsx b/react-flux-babel-karma/src/components/App.tsx similarity index 100% rename from es6-babel-react-flux-karma/src/components/App.tsx rename to react-flux-babel-karma/src/components/App.tsx diff --git a/es6-babel-react-flux-karma/src/components/Greeting.tsx b/react-flux-babel-karma/src/components/Greeting.tsx similarity index 100% rename from es6-babel-react-flux-karma/src/components/Greeting.tsx rename to react-flux-babel-karma/src/components/Greeting.tsx diff --git a/es6-babel-react-flux-karma/src/components/WhoToGreet.tsx b/react-flux-babel-karma/src/components/WhoToGreet.tsx similarity index 100% rename from es6-babel-react-flux-karma/src/components/WhoToGreet.tsx rename to react-flux-babel-karma/src/components/WhoToGreet.tsx diff --git a/es6-babel-react-flux-karma/src/dispatcher/AppDispatcher.ts b/react-flux-babel-karma/src/dispatcher/AppDispatcher.ts similarity index 100% rename from es6-babel-react-flux-karma/src/dispatcher/AppDispatcher.ts rename to react-flux-babel-karma/src/dispatcher/AppDispatcher.ts diff --git a/es6-babel-react-flux-karma/src/index.html b/react-flux-babel-karma/src/index.html similarity index 100% rename from es6-babel-react-flux-karma/src/index.html rename to react-flux-babel-karma/src/index.html diff --git a/es6-babel-react-flux-karma/src/main.tsx b/react-flux-babel-karma/src/main.tsx similarity index 100% rename from es6-babel-react-flux-karma/src/main.tsx rename to react-flux-babel-karma/src/main.tsx diff --git a/es6-babel-react-flux-karma/src/stores/FluxStore.ts b/react-flux-babel-karma/src/stores/FluxStore.ts similarity index 100% rename from es6-babel-react-flux-karma/src/stores/FluxStore.ts rename to react-flux-babel-karma/src/stores/FluxStore.ts diff --git a/es6-babel-react-flux-karma/src/stores/GreetingStore.ts b/react-flux-babel-karma/src/stores/GreetingStore.ts similarity index 100% rename from es6-babel-react-flux-karma/src/stores/GreetingStore.ts rename to react-flux-babel-karma/src/stores/GreetingStore.ts diff --git a/es6-babel-react-flux-karma/src/tsconfig.json b/react-flux-babel-karma/src/tsconfig.json similarity index 100% rename from es6-babel-react-flux-karma/src/tsconfig.json rename to react-flux-babel-karma/src/tsconfig.json diff --git a/es6-babel-react-flux-karma/src/types/GreetingState.ts b/react-flux-babel-karma/src/types/GreetingState.ts similarity index 100% rename from es6-babel-react-flux-karma/src/types/GreetingState.ts rename to react-flux-babel-karma/src/types/GreetingState.ts diff --git a/es6-babel-react-flux-karma/test/components/App.tests.tsx b/react-flux-babel-karma/test/components/App.tests.tsx similarity index 100% rename from es6-babel-react-flux-karma/test/components/App.tests.tsx rename to react-flux-babel-karma/test/components/App.tests.tsx diff --git a/es6-babel-react-flux-karma/test/components/Greeting.tests.tsx b/react-flux-babel-karma/test/components/Greeting.tests.tsx similarity index 100% rename from es6-babel-react-flux-karma/test/components/Greeting.tests.tsx rename to react-flux-babel-karma/test/components/Greeting.tests.tsx diff --git a/es6-babel-react-flux-karma/test/components/WhoToGreet.tests.tsx b/react-flux-babel-karma/test/components/WhoToGreet.tests.tsx similarity index 100% rename from es6-babel-react-flux-karma/test/components/WhoToGreet.tests.tsx rename to react-flux-babel-karma/test/components/WhoToGreet.tests.tsx diff --git a/es6-babel-react-flux-karma/test/import-babel-polyfill.js b/react-flux-babel-karma/test/import-babel-polyfill.js similarity index 100% rename from es6-babel-react-flux-karma/test/import-babel-polyfill.js rename to react-flux-babel-karma/test/import-babel-polyfill.js diff --git a/es6-babel-react-flux-karma/test/stores/GreetingStore.tests.ts b/react-flux-babel-karma/test/stores/GreetingStore.tests.ts similarity index 100% rename from es6-babel-react-flux-karma/test/stores/GreetingStore.tests.ts rename to react-flux-babel-karma/test/stores/GreetingStore.tests.ts diff --git a/es6-babel-react-flux-karma/test/tsconfig.json b/react-flux-babel-karma/test/tsconfig.json similarity index 100% rename from es6-babel-react-flux-karma/test/tsconfig.json rename to react-flux-babel-karma/test/tsconfig.json diff --git a/es6-babel-react-flux-karma/typings.json b/react-flux-babel-karma/typings.json similarity index 100% rename from es6-babel-react-flux-karma/typings.json rename to react-flux-babel-karma/typings.json diff --git a/es6-babel-react-flux-karma/webpack.config.js b/react-flux-babel-karma/webpack.config.js similarity index 100% rename from es6-babel-react-flux-karma/webpack.config.js rename to react-flux-babel-karma/webpack.config.js From 2f3fbda3951eb0acef7516ab9a3d27689d77eb63 Mon Sep 17 00:00:00 2001 From: Serguey Parkhomovsky Date: Wed, 6 Apr 2016 10:57:22 -0700 Subject: [PATCH 28/63] fix typescript.js location in systemjs sample --- systemjs/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemjs/index.html b/systemjs/index.html index f283603..545d88b 100644 --- a/systemjs/index.html +++ b/systemjs/index.html @@ -10,7 +10,7 @@ System.meta['typescript'] = { format: 'global', exports: 'ts' }; System.paths = { '*': '*.ts', - 'typescript': 'node_modules/typescript/bin/typescript.js' + 'typescript': 'node_modules/typescript/lib/typescript.js' } System.import('app').then(function(m) { var element = document.getElementById("content"); From 3914d39258c5dc2bfebcefd93db6de17d4c9385e Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 19 Apr 2016 13:12:37 -0700 Subject: [PATCH 29/63] update jspm sample --- jspm/config.js | 59 ------------------------------------------- jspm/index.html | 3 ++- jspm/jspm.browser.js | 9 +++++++ jspm/jspm.config.js | 60 ++++++++++++++++++++++++++++++++++++++++++++ jspm/package.json | 30 ++++++++++++++-------- 5 files changed, 90 insertions(+), 71 deletions(-) delete mode 100644 jspm/config.js create mode 100644 jspm/jspm.browser.js create mode 100644 jspm/jspm.config.js diff --git a/jspm/config.js b/jspm/config.js deleted file mode 100644 index 9949125..0000000 --- a/jspm/config.js +++ /dev/null @@ -1,59 +0,0 @@ -System.config({ - baseURL: "/", - defaultJSExtensions: true, - transpiler: "typescript", - paths: { - "*": "src/*", - "src": "src", - "github:*": "jspm_packages/github/*", - "npm:*": "jspm_packages/npm/*" - }, - - packages: { - "/src": { - "defaultExtension": "ts" - } - }, - - map: { - "core-js": "npm:core-js@0.9.18", - "typescript": "npm:typescript@1.5.3", - "github:jspm/nodelibs-buffer@0.1.0": { - "buffer": "npm:buffer@3.4.3" - }, - "github:jspm/nodelibs-os@0.1.0": { - "os-browserify": "npm:os-browserify@0.1.2" - }, - "github:jspm/nodelibs-path@0.1.0": { - "path-browserify": "npm:path-browserify@0.0.0" - }, - "github:jspm/nodelibs-process@0.1.1": { - "process": "npm:process@0.10.1" - }, - "npm:buffer@3.4.3": { - "base64-js": "npm:base64-js@0.0.8", - "ieee754": "npm:ieee754@1.1.6", - "is-array": "npm:is-array@1.0.1" - }, - "npm:core-js@0.9.18": { - "fs": "github:jspm/nodelibs-fs@0.1.2", - "process": "github:jspm/nodelibs-process@0.1.1", - "systemjs-json": "github:systemjs/plugin-json@0.1.0" - }, - "npm:os-browserify@0.1.2": { - "os": "github:jspm/nodelibs-os@0.1.0" - }, - "npm:path-browserify@0.0.0": { - "process": "github:jspm/nodelibs-process@0.1.1" - }, - "npm:typescript@1.5.3": { - "buffer": "github:jspm/nodelibs-buffer@0.1.0", - "child_process": "github:jspm/nodelibs-child_process@0.1.0", - "fs": "github:jspm/nodelibs-fs@0.1.2", - "os": "github:jspm/nodelibs-os@0.1.0", - "path": "github:jspm/nodelibs-path@0.1.0", - "process": "github:jspm/nodelibs-process@0.1.1", - "readline": "github:jspm/nodelibs-readline@0.1.0" - } - } -}); diff --git a/jspm/index.html b/jspm/index.html index 08741d0..c65d095 100644 --- a/jspm/index.html +++ b/jspm/index.html @@ -2,7 +2,8 @@ Jspm sample - + +
diff --git a/jspm/jspm.browser.js b/jspm/jspm.browser.js new file mode 100644 index 0000000..32cfcc2 --- /dev/null +++ b/jspm/jspm.browser.js @@ -0,0 +1,9 @@ +SystemJS.config({ + baseURL: "/", + paths: { + "*": "src/*", + "github:*": "jspm_packages/github/*", + "npm:*": "jspm_packages/npm/*", + "src": "src", + } +}); diff --git a/jspm/jspm.config.js b/jspm/jspm.config.js new file mode 100644 index 0000000..20ed71a --- /dev/null +++ b/jspm/jspm.config.js @@ -0,0 +1,60 @@ +SystemJS.config({ + transpiler: "plugin-typescript", + packages: { + "src": { + "defaultExtension": "ts", + } + } +}); + +SystemJS.config({ + packageConfigPaths: [ + "npm:@*/*.json", + "npm:*.json", + "github:*/*.json" + ], + map: { + "buffer": "github:jspm/nodelibs-buffer@0.2.0-alpha", + "child_process": "github:jspm/nodelibs-child_process@0.2.0-alpha", + "core-js": "npm:core-js@0.9.18", + "fs": "github:jspm/nodelibs-fs@0.2.0-alpha", + "os": "github:jspm/nodelibs-os@0.2.0-alpha", + "path": "github:jspm/nodelibs-path@0.2.0-alpha", + "plugin-typescript": "github:frankwallis/plugin-typescript@4.0.6", + "process": "github:jspm/nodelibs-process@0.2.0-alpha", + "readline": "github:jspm/nodelibs-readline@0.2.0-alpha", + "typescript": "npm:typescript@1.5.3" + }, + packages: { + "github:frankwallis/plugin-typescript@4.0.6": { + "map": { + "typescript": "npm:typescript@1.8.10" + } + }, + "github:jspm/nodelibs-buffer@0.2.0-alpha": { + "map": { + "buffer-browserify": "npm:buffer@4.5.1" + } + }, + "github:jspm/nodelibs-os@0.2.0-alpha": { + "map": { + "os-browserify": "npm:os-browserify@0.2.1" + } + }, + "npm:buffer@4.5.1": { + "map": { + "base64-js": "npm:base64-js@1.1.2", + "ieee754": "npm:ieee754@1.1.6", + "isarray": "npm:isarray@1.0.0" + } + }, + "npm:core-js@0.9.18": { + "map": { + "systemjs-json": "github:systemjs/plugin-json@0.1.0" + } + }, + "npm:typescript@1.5.3": { + "map": {} + } + } +}); diff --git a/jspm/package.json b/jspm/package.json index 33af451..9fde2cf 100644 --- a/jspm/package.json +++ b/jspm/package.json @@ -1,11 +1,19 @@ -{ - "jspm": { - "directories": {}, - "dependencies": { - "core-js": "npm:core-js@^0.9.4" - }, - "devDependencies": { - "typescript": "npm:typescript@1.5.3" - } - } -} +{ + "jspm": { + "directories": {}, + "dependencies": { + "core-js": "npm:core-js@^0.9.4" + }, + "devDependencies": { + "buffer": "github:jspm/nodelibs-buffer@^0.2.0-alpha", + "child_process": "github:jspm/nodelibs-child_process@^0.2.0-alpha", + "fs": "github:jspm/nodelibs-fs@^0.2.0-alpha", + "os": "github:jspm/nodelibs-os@^0.2.0-alpha", + "path": "github:jspm/nodelibs-path@^0.2.0-alpha", + "plugin-typescript": "github:frankwallis/plugin-typescript@^4.0.6", + "process": "github:jspm/nodelibs-process@^0.2.0-alpha", + "readline": "github:jspm/nodelibs-readline@^0.2.0-alpha", + "typescript": "npm:typescript@1.8.10" + } + } +} From 2cce037b1b6ff4287c97e8dbab6e30809f37bbab Mon Sep 17 00:00:00 2001 From: Billy- Date: Sat, 23 Apr 2016 00:55:29 +0100 Subject: [PATCH 30/63] Amended readme Folder was renamed: 592ef33b0a9a115c48bf7909ae494b73cc72b8d1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c6db42..c9f8390 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ##### [D3](d3/README.md) -##### [ES6 + TypeScript + Babel + React + Karma: The Secret Recipe](es6-babel-react-flux-karma/README.md) +##### [React + Flux + Babel + Karma: The Secret Recipe](react-flux-babel-karma/README.md) ##### [Greeter](greeter/README.md) From 8d0d13142e2b27beae3c3ae814099212d06b406c Mon Sep 17 00:00:00 2001 From: MC Date: Wed, 27 Apr 2016 13:09:05 +0800 Subject: [PATCH 31/63] no typings/tsd.d.ts file if using 'update' --- jsx/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsx/package.json b/jsx/package.json index 540cd88..71552b9 100644 --- a/jsx/package.json +++ b/jsx/package.json @@ -5,7 +5,7 @@ "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "postinstall": "node_modules/.bin/tsd update", + "postinstall": "node_modules/.bin/tsd install", "build": "node node_modules/typescript/bin/tsc", "run": "node node_modules/http-server/bin/http-server -o" }, From 3b631ca165196fef6dd4610ed9f9c94dd90adc9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Del=C3=A9pine?= Date: Wed, 1 Jun 2016 17:27:34 +0200 Subject: [PATCH 32/63] use a relative url to firebase --- angular2/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular2/index.html b/angular2/index.html index 8b4dfca..a8f1f5f 100644 --- a/angular2/index.html +++ b/angular2/index.html @@ -24,7 +24,7 @@ - + Loading... From 9e6e010e948edf743c97f733ebe2f1d0ea3e9a1a Mon Sep 17 00:00:00 2001 From: Isidoro Ghezzi Date: Sat, 4 Jun 2016 15:27:10 +0200 Subject: [PATCH 33/63] raytracer.ts: calling rayTracer.render using canvas width and height --- raytracer/raytracer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raytracer/raytracer.ts b/raytracer/raytracer.ts index 0aa0748..450d8a5 100644 --- a/raytracer/raytracer.ts +++ b/raytracer/raytracer.ts @@ -271,7 +271,7 @@ function exec() { document.body.appendChild(canv); var ctx = canv.getContext("2d"); var rayTracer = new RayTracer(); - return rayTracer.render(defaultScene(), ctx, 256, 256); + return rayTracer.render(defaultScene(), ctx, canv.width, canv.height); } exec(); From 2fe96cc85db82005f5b69c32f72f52065b944c60 Mon Sep 17 00:00:00 2001 From: guybedford Date: Sun, 19 Jun 2016 14:56:00 +0200 Subject: [PATCH 34/63] jspm beta latest update --- jspm/index.html | 1 - jspm/jspm.browser.js | 9 ------ jspm/jspm.config.js | 74 +++++++++++++++++++------------------------- jspm/package.json | 28 +++++++++++------ jspm/src/app.ts | 2 +- 5 files changed, 52 insertions(+), 62 deletions(-) delete mode 100644 jspm/jspm.browser.js diff --git a/jspm/index.html b/jspm/index.html index c65d095..0b6851c 100644 --- a/jspm/index.html +++ b/jspm/index.html @@ -2,7 +2,6 @@ Jspm sample - diff --git a/jspm/jspm.browser.js b/jspm/jspm.browser.js deleted file mode 100644 index 32cfcc2..0000000 --- a/jspm/jspm.browser.js +++ /dev/null @@ -1,9 +0,0 @@ -SystemJS.config({ - baseURL: "/", - paths: { - "*": "src/*", - "github:*": "jspm_packages/github/*", - "npm:*": "jspm_packages/npm/*", - "src": "src", - } -}); diff --git a/jspm/jspm.config.js b/jspm/jspm.config.js index 20ed71a..06f99cc 100644 --- a/jspm/jspm.config.js +++ b/jspm/jspm.config.js @@ -1,8 +1,35 @@ SystemJS.config({ transpiler: "plugin-typescript", packages: { - "src": { - "defaultExtension": "ts", + "app": { + "main": "app.ts", + "defaultExtension": "ts" + } + }, + browserConfig: { + baseURL: "/", + paths: { + "app/": "src/", + "github:": "jspm_packages/github/", + "npm:": "jspm_packages/npm/" + } + }, + devConfig: { + "map": { + "plugin-typescript": "github:frankwallis/plugin-typescript@4.0.6", + "os": "github:jspm/nodelibs-os@0.2.0-alpha" + }, + "packages": { + "github:frankwallis/plugin-typescript@4.0.6": { + "map": { + "typescript": "npm:typescript@1.8.10" + } + }, + "github:jspm/nodelibs-os@0.2.0-alpha": { + "map": { + "os-browserify": "npm:os-browserify@0.2.1" + } + } } } }); @@ -14,47 +41,10 @@ SystemJS.config({ "github:*/*.json" ], map: { - "buffer": "github:jspm/nodelibs-buffer@0.2.0-alpha", - "child_process": "github:jspm/nodelibs-child_process@0.2.0-alpha", - "core-js": "npm:core-js@0.9.18", + "core-js": "npm:core-js@2.4.0", "fs": "github:jspm/nodelibs-fs@0.2.0-alpha", - "os": "github:jspm/nodelibs-os@0.2.0-alpha", "path": "github:jspm/nodelibs-path@0.2.0-alpha", - "plugin-typescript": "github:frankwallis/plugin-typescript@4.0.6", - "process": "github:jspm/nodelibs-process@0.2.0-alpha", - "readline": "github:jspm/nodelibs-readline@0.2.0-alpha", - "typescript": "npm:typescript@1.5.3" + "process": "github:jspm/nodelibs-process@0.2.0-alpha" }, - packages: { - "github:frankwallis/plugin-typescript@4.0.6": { - "map": { - "typescript": "npm:typescript@1.8.10" - } - }, - "github:jspm/nodelibs-buffer@0.2.0-alpha": { - "map": { - "buffer-browserify": "npm:buffer@4.5.1" - } - }, - "github:jspm/nodelibs-os@0.2.0-alpha": { - "map": { - "os-browserify": "npm:os-browserify@0.2.1" - } - }, - "npm:buffer@4.5.1": { - "map": { - "base64-js": "npm:base64-js@1.1.2", - "ieee754": "npm:ieee754@1.1.6", - "isarray": "npm:isarray@1.0.0" - } - }, - "npm:core-js@0.9.18": { - "map": { - "systemjs-json": "github:systemjs/plugin-json@0.1.0" - } - }, - "npm:typescript@1.5.3": { - "map": {} - } - } + packages: {} }); diff --git a/jspm/package.json b/jspm/package.json index 9fde2cf..e6abe6e 100644 --- a/jspm/package.json +++ b/jspm/package.json @@ -1,19 +1,29 @@ { "jspm": { - "directories": {}, "dependencies": { - "core-js": "npm:core-js@^0.9.4" + "core-js": "npm:core-js@^2.4.0" }, "devDependencies": { - "buffer": "github:jspm/nodelibs-buffer@^0.2.0-alpha", - "child_process": "github:jspm/nodelibs-child_process@^0.2.0-alpha", - "fs": "github:jspm/nodelibs-fs@^0.2.0-alpha", "os": "github:jspm/nodelibs-os@^0.2.0-alpha", + "plugin-typescript": "github:frankwallis/plugin-typescript@^4.0.6" + }, + "peerDependencies": { + "fs": "github:jspm/nodelibs-fs@^0.2.0-alpha", "path": "github:jspm/nodelibs-path@^0.2.0-alpha", - "plugin-typescript": "github:frankwallis/plugin-typescript@^4.0.6", - "process": "github:jspm/nodelibs-process@^0.2.0-alpha", - "readline": "github:jspm/nodelibs-readline@^0.2.0-alpha", - "typescript": "npm:typescript@1.8.10" + "process": "github:jspm/nodelibs-process@^0.2.0-alpha" + }, + "overrides": { + "npm:typescript@1.8.10": { + "browser": {}, + "map": { + "buffer": "@empty", + "child_process": "@empty", + "fs": "@empty", + "path": "@empty", + "process": "@empty", + "readline": "@empty" + } + } } } } diff --git a/jspm/src/app.ts b/jspm/src/app.ts index eb60899..fe88d51 100644 --- a/jspm/src/app.ts +++ b/jspm/src/app.ts @@ -1,4 +1,4 @@ -import { Greeter } from 'greeter' +import { Greeter } from './greeter' export function main(el: HTMLElement): void { let greeter = new Greeter(el); From 69d9f3033925bf2d983e7baade32f3d935e37d69 Mon Sep 17 00:00:00 2001 From: tabradford Date: Tue, 19 Jul 2016 11:11:50 -0400 Subject: [PATCH 35/63] findOne is deprecated. Changed findOne instances to .batchSize(10).nextObject() in order to ovoid negative externalities of rare corner cases. --- imageboard/db.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/imageboard/db.ts b/imageboard/db.ts index c927607..ad85c69 100644 --- a/imageboard/db.ts +++ b/imageboard/db.ts @@ -1,7 +1,7 @@ // Mongo import mongodb = require('mongodb'); -var server = new mongodb.Server('localhost', 27017, {auto_reconnect: true}) +var server = new mongodb.Server('localhost', 27017, {auto_reconnect: true}); var db = new mongodb.Db('mydb', server, { w: 1 }); db.open(function() {}); @@ -33,9 +33,9 @@ export interface Image { export function getUser(id: string, callback: (user: User) => void) { db.collection('users', function(error, users) { if(error) { console.error(error); return; } - users.findOne({_id: id}, function(error, user) { - if(error) { console.error(error); return; } - callback(user); + users.find({_id: id}).batchSize(10).nextObject(function(error, user) { + if(error) { console.error(error); return; } + callback(user); }); }); } @@ -53,7 +53,7 @@ export function getUsers(callback: (users: User[]) => void) { export function getImage(imageId: string, callback: (image: Image) => void) { db.collection('images', function(error, images_collection) { if(error) { console.error(error); return; } - images_collection.findOne({_id: new mongodb.ObjectID(imageId)}, function(error, image) { + images_collection.find({_id: new mongodb.ObjectID(imageId)}).batchSize(10).nextObject(function(error, image) { if(error) { console.error(error); return; } callback(image); }); From 5aaeb56de33f4be46dad44b2e7bb845d234fad0a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 5 Aug 2016 14:09:45 -0700 Subject: [PATCH 36/63] Added general README and updated Browserify README. --- README.md | 10 ++++++++++ browserify/README.md | 42 ++++++++++++++++++++++++++++++------------ 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c9f8390..26d30d5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,15 @@ # TypeScript Samples +Most of the samples here will assume that you have TypeScript installed. +You can get TypeScript with Visual Studio, NuGet, or with npm: + +```shell +npm install -g typescript +``` + +To compile each sample, `cd` into the directory and use the `tsc` command to compile. +`tsc` will use each directory's `tsconfig.json` to get specific compiler options. + ##### [AMD Modules](amd/README.md) ##### [Angular Seed TypeScript](angular1/README.md) diff --git a/browserify/README.md b/browserify/README.md index 092fe7d..ea600ee 100644 --- a/browserify/README.md +++ b/browserify/README.md @@ -1,45 +1,63 @@ **Install Browserify** -``` + +```shell npm install -g browserify ``` **Fetch dependencies** -``` + +```shell npm install ``` **Compile .ts files** -``` + +Either enter the following command + +```shell node node_modules/typescript/bin/tsc.js ``` -shortcut for this command -``` + +or use the `tsc` script from our `package.json` with + +```shell npm run tsc ``` **Run Browserify** -``` + +Either enter the following command + +```shell browserify src/app.js -o bundle.js -s app ``` -shortcut for this command -``` + +or use the `browserify` script from our `package.json` with + +```shell npm run browserify ``` **Start http-server** -``` + +Either enter the following command + +```shell node node_modules/http-server/bin/http-server -o ``` -shortcut for this command + +or use the `listen` script from our `package.json` with + ``` npm run listen ``` -By default http-server listens on port 8080. If this port is taken use '-p' to specify free port. - +By default http-server listens on port `8080`. +If this port is taken, use '-p ####' to specify a free port, where `####` is the available port. **Shortcut for running all steps in a batch** + ``` npm run all ``` \ No newline at end of file From 8c1c2403ab4e472820124d2da7584d501b7b62e8 Mon Sep 17 00:00:00 2001 From: Cristian Ronzio Date: Sun, 28 Aug 2016 12:37:05 +0200 Subject: [PATCH 37/63] typings config refactor needed by latest definition manager version >=1.0.0 --- react-flux-babel-karma/src/tsconfig.json | 14 +++++++------- react-flux-babel-karma/test/tsconfig.json | 14 +++++++------- react-flux-babel-karma/typings.json | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/react-flux-babel-karma/src/tsconfig.json b/react-flux-babel-karma/src/tsconfig.json index 5abc4cb..2ec4842 100644 --- a/react-flux-babel-karma/src/tsconfig.json +++ b/react-flux-babel-karma/src/tsconfig.json @@ -1,9 +1,9 @@ { "compileOnSave": false, "filesGlob": [ - "../typings/browser/**/*.*.ts", - "!../typings/browser/ambient/jasmine/index.d.ts", - "!../typings/browser/ambient/react-addons-test-utils/index.d.ts", + "../typings/globals/**/*.*.ts", + "!../typings/globals/jasmine/index.d.ts", + "!../typings/globals/react-addons-test-utils/index.d.ts", "**/*.{ts,tsx}" ], "compilerOptions": { @@ -15,10 +15,10 @@ "sourceMap": true }, "files": [ - "../typings/browser/ambient/react/index.d.ts", - "../typings/browser/ambient/react-dom/index.d.ts", - "../typings/browser/ambient/flux/index.d.ts", - "../typings/browser/ambient/node/index.d.ts", + "../typings/globals/react/index.d.ts", + "../typings/globals/react-dom/index.d.ts", + "../typings/globals/flux/index.d.ts", + "../typings/globals/node/index.d.ts", "actions/GreetingActions.ts", "components/App.tsx", "components/Greeting.tsx", diff --git a/react-flux-babel-karma/test/tsconfig.json b/react-flux-babel-karma/test/tsconfig.json index b1aef87..8ab80b6 100644 --- a/react-flux-babel-karma/test/tsconfig.json +++ b/react-flux-babel-karma/test/tsconfig.json @@ -2,7 +2,7 @@ "compileOnSave": false, "filesGlob": [ "**/*.{ts,tsx}", - "../typings/browser/**/*.*.ts" + "../typings/globals/**/*.*.ts" ], "compilerOptions": { "jsx": "preserve", @@ -13,12 +13,12 @@ "sourceMap": true }, "files": [ - "../typings/browser/ambient/react/index.d.ts", - "../typings/browser/ambient/react-dom/index.d.ts", - "../typings/browser/ambient/react-addons-test-utils/index.d.ts", - "../typings/browser/ambient/flux/index.d.ts", - "../typings/browser/ambient/jasmine/index.d.ts", - "../typings/browser/ambient/node/index.d.ts", + "../typings/globals/react/index.d.ts", + "../typings/globals/react-dom/index.d.ts", + "../typings/globals/react-addons-test-utils/index.d.ts", + "../typings/globals/flux/index.d.ts", + "../typings/globals/jasmine/index.d.ts", + "../typings/globals/node/index.d.ts", "components/App.tests.tsx", "components/Greeting.tests.tsx", "components/WhoToGreet.tests.tsx", diff --git a/react-flux-babel-karma/typings.json b/react-flux-babel-karma/typings.json index 4be13c1..9cd2b81 100644 --- a/react-flux-babel-karma/typings.json +++ b/react-flux-babel-karma/typings.json @@ -1,7 +1,7 @@ { "name": "es6-babel-react-flux-karma", "version": false, - "ambientDependencies": { + "globalDependencies": { "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054", "flux": "github:DefinitelyTyped/DefinitelyTyped/flux/flux.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054", "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054", From bd78ccf119dada24f6204cecf4303088a1ec9ea8 Mon Sep 17 00:00:00 2001 From: jrpelkonen Date: Tue, 30 Aug 2016 07:58:58 -0500 Subject: [PATCH 38/63] Fixes #96 --- todomvc/js/todos.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/todomvc/js/todos.ts b/todomvc/js/todos.ts index 6128289..0263053 100644 --- a/todomvc/js/todos.ts +++ b/todomvc/js/todos.ts @@ -202,6 +202,8 @@ class TodoView extends Backbone.View { input: JQuery; constructor (options? ) { + // A call to super() is needed to avoid TS17009. + super(); //... is a list tag. this.tagName = "li"; @@ -373,4 +375,4 @@ class AppView extends Backbone.View { $(() => { // Finally, we kick things off by creating the **App**. new AppView(); -}); \ No newline at end of file +}); From e63c39bbd1e01480df4fef5293a5ecd2944e08d8 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 21 Sep 2016 09:16:16 -0400 Subject: [PATCH 39/63] Remove extra super call. --- todomvc/js/todos.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/todomvc/js/todos.ts b/todomvc/js/todos.ts index 0263053..df6947e 100644 --- a/todomvc/js/todos.ts +++ b/todomvc/js/todos.ts @@ -57,7 +57,7 @@ declare module Backbone { toJSON(): any; } export class Collection { - constructor (models? , opts? ); + constructor (models?, opts?); bind(ev: string, f: Function, ctx?: any): void; length: number; create(attrs, opts? ): any; @@ -69,7 +69,7 @@ declare module Backbone { without(...values: T[]): T[]; } export class View { - constructor (options? ); + constructor (options?); $(selector: string): JQuery; el: HTMLElement; $el: JQuery; @@ -201,9 +201,8 @@ class TodoView extends Backbone.View { model: Todo; input: JQuery; - constructor (options? ) { - // A call to super() is needed to avoid TS17009. - super(); + constructor (options?) { + super(options); //... is a list tag. this.tagName = "li"; @@ -216,8 +215,6 @@ class TodoView extends Backbone.View { "blur .todo-input": "close" }; - super(options); - // Cache the template function for a single item. this.template = _.template($('#item-template').html()); From b1ef595e7a947fa5bdfb96a11db555066b879f73 Mon Sep 17 00:00:00 2001 From: rookieKing Date: Sun, 20 Nov 2016 12:29:01 +0800 Subject: [PATCH 40/63] Fix Suffix --- amd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amd/README.md b/amd/README.md index ff7ae78..5170210 100644 --- a/amd/README.md +++ b/amd/README.md @@ -9,6 +9,6 @@ It uses [require.js](http://www.requirejs.org/) to load `app.js` once compiled f ``` tsc --sourcemap --module amd app.ts -start default.htm +start default.html ``` From 4656e93224b27af73619e759d735b7883d027dce Mon Sep 17 00:00:00 2001 From: rookieKing Date: Sun, 20 Nov 2016 13:24:45 +0800 Subject: [PATCH 41/63] Update http-server --- systemjs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemjs/package.json b/systemjs/package.json index ae2fc65..1a6cf45 100644 --- a/systemjs/package.json +++ b/systemjs/package.json @@ -7,7 +7,7 @@ "url": "https://github.com/Microsoft/TypeScriptSamples.git" }, "dependencies": { - "http-server": "0.8.0", + "http-server": "0.9.0", "systemjs": "0.18.0" }, "devDependencies": { From 5edae86414b1e1d799785355cdf8ca6498a1b7e9 Mon Sep 17 00:00:00 2001 From: Roger Date: Tue, 6 Dec 2016 21:40:00 -0500 Subject: [PATCH 42/63] Internet Explore -> Internet Explorer --- todomvc/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todomvc/README.md b/todomvc/README.md index 1e7c0a5..5210584 100644 --- a/todomvc/README.md +++ b/todomvc/README.md @@ -18,7 +18,7 @@ start index.html ## Caveats ``` -This sample uses local storage and will not run properly on Internet Explore if run +This sample uses local storage and will not run properly on Internet Explorer if run from the local filesystem. Instead, host the sample from a web server (eg. IIS). From 39dcc4437c47dfb01025c3a155f4066b9c9c930f Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 10 Dec 2016 10:01:25 +0000 Subject: [PATCH 43/63] Upgrade to TypeScript 2.1 Use @types to acquire type definitions Upgrade emit to ES2016 Upgrade React to 15 Switch to using fbemitter --- react-flux-babel-karma/README.md | 8 +- react-flux-babel-karma/gulp/webpack.js | 153 +++++++++--------- react-flux-babel-karma/karma.conf.js | 12 +- react-flux-babel-karma/package.json | 37 +++-- react-flux-babel-karma/src/components/App.tsx | 10 +- .../src/components/Greeting.tsx | 5 +- .../src/components/WhoToGreet.tsx | 7 +- .../src/dispatcher/AppDispatcher.ts | 2 +- react-flux-babel-karma/src/main.tsx | 5 +- .../src/stores/FluxStore.ts | 10 +- .../src/stores/GreetingStore.ts | 2 +- react-flux-babel-karma/src/tsconfig.json | 35 ---- .../test/components/App.tests.tsx | 5 +- .../test/components/Greeting.tests.tsx | 7 +- .../test/components/WhoToGreet.tests.tsx | 7 +- .../test/import-babel-polyfill.js | 1 - react-flux-babel-karma/test/main.js | 5 + react-flux-babel-karma/test/tsconfig.json | 30 ---- react-flux-babel-karma/tsconfig.json | 22 +++ react-flux-babel-karma/typings.json | 12 -- 20 files changed, 170 insertions(+), 205 deletions(-) delete mode 100644 react-flux-babel-karma/src/tsconfig.json delete mode 100644 react-flux-babel-karma/test/import-babel-polyfill.js create mode 100644 react-flux-babel-karma/test/main.js delete mode 100644 react-flux-babel-karma/test/tsconfig.json create mode 100644 react-flux-babel-karma/tsconfig.json delete mode 100644 react-flux-babel-karma/typings.json diff --git a/react-flux-babel-karma/README.md b/react-flux-babel-karma/README.md index bdefa0b..f7f2bf6 100644 --- a/react-flux-babel-karma/README.md +++ b/react-flux-babel-karma/README.md @@ -2,19 +2,17 @@ ## Getting started -You'll need [node / npm](https://nodejs.org/) and [Typings](https://github.com/typings/typings) installed globally. To get up and running just enter: +You'll need [node / npm](https://nodejs.org/) installed. To get up and running just enter: ``` npm install -typings install npm run serve ``` This will: -1. Download the npm packages you need -2. Download the type definitions from DefinitelyTyped that you need. -3. Compile the code and serve it up at [http://localhost:8080](http://localhost:8080) +1. Download the npm packages you need (including the type definitions from DefinitelyTyped) +2. Compile the code and serve it up at [http://localhost:8080](http://localhost:8080) Now you need dev tools. There's a world of choice out there; there's [Atom](https://atom.io/), there's [VS Code](https://www.visualstudio.com/en-us/products/code-vs.aspx), there's [Sublime](http://www.sublimetext.com/). There's even something called [Visual Studio](http://www.visualstudio.com). It's all your choice really. diff --git a/react-flux-babel-karma/gulp/webpack.js b/react-flux-babel-karma/gulp/webpack.js index 65af421..f3cff9c 100644 --- a/react-flux-babel-karma/gulp/webpack.js +++ b/react-flux-babel-karma/gulp/webpack.js @@ -3,91 +3,96 @@ var gulp = require('gulp'); var gutil = require('gulp-util'); var webpack = require('webpack'); -var failPlugin = require('webpack-fail-plugin'); var WebpackNotifierPlugin = require('webpack-notifier'); +var failPlugin = require('webpack-fail-plugin'); var webpackConfig = require('../webpack.config.js'); +var packageJson = require('../package.json'); function buildProduction(done) { - // modify some webpack config options - var myProdConfig = Object.create(webpackConfig); - myProdConfig.output.filename = '[name].[hash].js'; - - myProdConfig.plugins = myProdConfig.plugins.concat( - new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.[hash].js' }), - new webpack.optimize.DedupePlugin(), - new webpack.optimize.UglifyJsPlugin(), - failPlugin - ); - - // run webpack - webpack(myProdConfig, function(err, stats) { - if (err) { throw new gutil.PluginError('webpack:build', err); } - gutil.log('[webpack:build]', stats.toString({ - colors: true - })); - - if (done) { done(); } - }); + // modify some webpack config options + var myProdConfig = Object.create(webpackConfig); + myProdConfig.output.filename = '[name].[hash].js'; + + myProdConfig.plugins = myProdConfig.plugins.concat( + new webpack.DefinePlugin({ + 'process.env': { + 'NODE_ENV': JSON.stringify('production') + } + }), + new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.[hash].js' }), + new webpack.optimize.DedupePlugin(), + new webpack.optimize.UglifyJsPlugin(), + failPlugin + ); + + // run webpack + webpack(myProdConfig, function (err, stats) { + if (err) { throw new gutil.PluginError('webpack:build', err); } + gutil.log('[webpack:build]', stats.toString({ + colors: true + })); + + if (done) { done(); } + }); } function createDevCompiler() { - // modify some webpack config options - var myDevConfig = Object.create(webpackConfig); - myDevConfig.devtool = 'inline-source-map'; - myDevConfig.debug = true; - - myDevConfig.plugins = myDevConfig.plugins.concat( - new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.js' }), - new WebpackNotifierPlugin({ title: 'Webpack build', excludeWarnings: true }) - ); - - // create a single instance of the compiler to allow caching - return webpack(myDevConfig); + // modify some webpack config options + var myDevConfig = Object.create(webpackConfig); + myDevConfig.devtool = 'inline-source-map'; + myDevConfig.debug = true; + + myDevConfig.plugins = myDevConfig.plugins.concat( + new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.js' }), + new WebpackNotifierPlugin({ title: 'Webpack build', excludeWarnings: true }) + ); + + // create a single instance of the compiler to allow caching + return webpack(myDevConfig); } -function buildDevelopment(done, devCompiler) { - // run webpack - devCompiler.run(function(err, stats) { - if (err) { throw new gutil.PluginError('webpack:build-dev', err); } - gutil.log('[webpack:build-dev]', stats.toString({ - chunks: false, - colors: true - })); - - if (done) { done(); } - }); +function build() { + return new Promise(function (resolve, reject) { + buildProduction(function (err) { + if (err) { + reject(err); + } else { + resolve('webpack built'); + } + }); + }); } - -function bundle(options) { - var devCompiler; - - function build(done) { - if (options.shouldWatch) { - buildDevelopment(done, devCompiler); - } else { - buildProduction(done); - } - } - - if (options.shouldWatch) { - devCompiler = createDevCompiler(); - - gulp.watch('src/**/*', function() { build(); }); - } - - return new Promise(function(resolve, reject) { - build(function (err) { - if (err) { - reject(err); - } else { - resolve('webpack built'); - } - }); - }); +function watch() { + var firstBuildDone = false; + + return new Promise(function (resolve, reject) { + var devCompiler = createDevCompiler(); + devCompiler.watch({ // watch options: + aggregateTimeout: 300 // wait so long for more changes + }, function (err, stats) { + if (err) { + if (!firstBuildDone) { + firstBuildDone = true; + reject(err); + } + throw new gutil.PluginError('webpack:build-dev', err); + } else { + if (!firstBuildDone) { + firstBuildDone = true; + resolve('webpack built'); + } + } + + gutil.log('[webpack:build-dev]', stats.toString({ + chunks: false, + colors: true + })); + }); + }); } module.exports = { - build: function() { return bundle({ shouldWatch: false }); }, - watch: function() { return bundle({ shouldWatch: true }); } -}; + build: function () { return build(); }, + watch: function () { return watch(); } +}; \ No newline at end of file diff --git a/react-flux-babel-karma/karma.conf.js b/react-flux-babel-karma/karma.conf.js index 10ffba7..7257992 100644 --- a/react-flux-babel-karma/karma.conf.js +++ b/react-flux-babel-karma/karma.conf.js @@ -9,9 +9,9 @@ module.exports = function(config) { browsers: [ 'PhantomJS' ], files: [ - 'test/import-babel-polyfill.js', // This ensures we have the es6 shims in place from babel - 'test/**/*.tests.ts', - 'test/**/*.tests.tsx' + // This ensures we have the es6 shims in place from babel and that angular and angular-mocks are loaded + // and then loads all the tests + 'test/main.js' ], port: 9876, @@ -21,13 +21,11 @@ module.exports = function(config) { logLevel: config.LOG_INFO, //config.LOG_DEBUG preprocessors: { - 'test/import-babel-polyfill.js': [ 'webpack', 'sourcemap' ], - 'src/**/*.{ts,tsx}': [ 'webpack', 'sourcemap' ], - 'test/**/*.tests.{ts,tsx}': [ 'webpack', 'sourcemap' ] + 'test/main.js': [ 'webpack', 'sourcemap' ] }, webpack: { - devtool: 'eval-source-map', //'inline-source-map', + devtool: 'inline-source-map', debug: true, module: webpackConfig.module, resolve: webpackConfig.resolve diff --git a/react-flux-babel-karma/package.json b/react-flux-babel-karma/package.json index 21fd63b..99168a7 100644 --- a/react-flux-babel-karma/package.json +++ b/react-flux-babel-karma/package.json @@ -16,7 +16,7 @@ "keywords": [ "React", "Flux", - "ES6", + "ES2016", "typescript" ], "author": "John Reilly", @@ -26,16 +26,22 @@ }, "homepage": "https://github.com/Microsoft/TypeScriptSamples/tree/master/es6-babel-react-flux-karma#readme", "devDependencies": { + "@types/fbemitter": "^2.0.32", + "@types/flux": "0.0.32", + "@types/jasmine": "^2.5.35", + "@types/react": "^0.14.41", + "@types/react-addons-test-utils": "^0.14.15", + "@types/react-bootstrap": "0.0.33", + "@types/react-dom": "^0.14.18", "babel": "^6.0.0", "babel-core": "^6.0.0", "babel-loader": "^6.0.0", - "babel-polyfill": "^6.0.0", "babel-preset-es2015": "^6.0.0", + "babel-preset-es2016": "^6.16.0", "babel-preset-react": "^6.0.0", "del": "^2.0.2", "eslint": "^2.0.0", "express": "^4.13.3", - "flux": "^2.0.3", "glob": "^7.0.0", "gulp": "^3.9.0", "gulp-autoprefixer": "^3.1.0", @@ -50,23 +56,28 @@ "gulp-uglify": "^1.2.0", "gulp-util": "^3.0.6", "jasmine-core": "^2.3.4", - "karma": "^0.13.10", - "karma-coverage": "^0.5.2", - "karma-jasmine": "^0.3.6", - "karma-junit-reporter": "^0.3.7", + "karma": "^1.2.0", + "karma-coverage": "^1.0.0", + "karma-jasmine": "^1.0.0", + "karma-junit-reporter": "^1.0.0", "karma-mocha-reporter": "^2.0.0", - "karma-notify-reporter": "^0.1.1", + "karma-notify-reporter": "^1.0.0", "karma-phantomjs-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.6", "karma-webpack": "^1.7.0", "phantomjs-prebuilt": "^2.1.4", - "react": "^0.14.3", - "react-addons-test-utils": "^0.14.3", - "react-dom": "^0.14.3", - "ts-loader": "^0.8.1", - "typescript": "^1.8.0", + "ts-loader": "^1.3.1", + "typescript": "^2.1.4", "webpack": "^1.12.2", "webpack-fail-plugin": "^1.0.4", "webpack-notifier": "^1.2.1" + }, + "dependencies": { + "babel-polyfill": "^6.0.0", + "flux": "^2.0.3", + "fbemitter": "^2.0.2", + "react": "^15.4.1", + "react-addons-test-utils": "^15.4.1", + "react-dom": "^15.4.1" } } diff --git a/react-flux-babel-karma/src/components/App.tsx b/react-flux-babel-karma/src/components/App.tsx index e43face..99cbd30 100644 --- a/react-flux-babel-karma/src/components/App.tsx +++ b/react-flux-babel-karma/src/components/App.tsx @@ -1,11 +1,13 @@ -import * as React from 'react'; +import React from 'react'; +import FBEmitter from "fbemitter"; + import GreetingStore from '../stores/GreetingStore'; -import * as GreetingActions from '../actions/GreetingActions'; import GreetingState from '../types/GreetingState'; import WhoToGreet from './WhoToGreet'; import Greeting from './Greeting'; class App extends React.Component<{}, GreetingState> { + eventSubscription: FBEmitter.EventSubscription; constructor(props: {}) { super(props); this.state = this.getStateFromStores(); @@ -15,11 +17,11 @@ class App extends React.Component<{}, GreetingState> { } public componentWillMount() { - GreetingStore.addChangeListener(this.onChange); + this.eventSubscription = GreetingStore.addChangeListener(this.onChange); } public componentWillUnmount() { - GreetingStore.removeChangeListener(this.onChange); + this.eventSubscription.remove(); } render() { diff --git a/react-flux-babel-karma/src/components/Greeting.tsx b/react-flux-babel-karma/src/components/Greeting.tsx index 7d1502b..0305fdb 100644 --- a/react-flux-babel-karma/src/components/Greeting.tsx +++ b/react-flux-babel-karma/src/components/Greeting.tsx @@ -1,4 +1,5 @@ -import * as React from 'react'; +import React from 'react'; + import * as GreetingActions from '../actions/GreetingActions'; interface Props { @@ -28,7 +29,7 @@ class Greeting extends React.Component { ); } - _onClick = (event: React.MouseEvent) => { + _onClick = (_event: React.MouseEvent) => { GreetingActions.removeGreeting(this.props.targetOfGreeting); } } diff --git a/react-flux-babel-karma/src/components/WhoToGreet.tsx b/react-flux-babel-karma/src/components/WhoToGreet.tsx index 6712746..eac78fe 100644 --- a/react-flux-babel-karma/src/components/WhoToGreet.tsx +++ b/react-flux-babel-karma/src/components/WhoToGreet.tsx @@ -1,4 +1,5 @@ -import * as React from 'react'; +import React from 'react'; + import * as GreetingActions from '../actions/GreetingActions'; interface Props { @@ -35,12 +36,12 @@ class WhoToGreet extends React.Component { return !this.props.newGreeting; } - _handleNewGreetingChange = (event: React.FormEvent) => { + _handleNewGreetingChange = (event: React.FormEvent) => { const newGreeting = (event.target as HTMLInputElement).value; GreetingActions.newGreetingChanged(newGreeting); } - _onSubmit = (event: React.FormEvent) => { + _onSubmit = (event: React.FormEvent) => { event.preventDefault(); if (!this._preventSubmission) { diff --git a/react-flux-babel-karma/src/dispatcher/AppDispatcher.ts b/react-flux-babel-karma/src/dispatcher/AppDispatcher.ts index 83f413c..be9360f 100644 --- a/react-flux-babel-karma/src/dispatcher/AppDispatcher.ts +++ b/react-flux-babel-karma/src/dispatcher/AppDispatcher.ts @@ -6,6 +6,6 @@ export class TypedEvent

{ export type Event = TypedEvent; -const dispatcherInstance: Flux.Dispatcher = new Dispatcher(); +const dispatcherInstance: Dispatcher = new Dispatcher(); export { dispatcherInstance as AppDispatcher }; diff --git a/react-flux-babel-karma/src/main.tsx b/react-flux-babel-karma/src/main.tsx index 1e14a73..65b3f94 100644 --- a/react-flux-babel-karma/src/main.tsx +++ b/react-flux-babel-karma/src/main.tsx @@ -1,6 +1,7 @@ import 'babel-polyfill'; -import * as React from 'react'; -import * as ReactDOM from 'react-dom'; +import React from 'react'; +import ReactDOM from 'react-dom'; + import App from './components/App'; ReactDOM.render(, document.getElementById('content')); diff --git a/react-flux-babel-karma/src/stores/FluxStore.ts b/react-flux-babel-karma/src/stores/FluxStore.ts index 4ef8407..758ec6c 100644 --- a/react-flux-babel-karma/src/stores/FluxStore.ts +++ b/react-flux-babel-karma/src/stores/FluxStore.ts @@ -1,4 +1,4 @@ -import { EventEmitter } from 'events'; +import { EventEmitter } from 'fbemitter'; import { Event } from '../dispatcher/AppDispatcher'; import * as Flux from "flux"; @@ -34,14 +34,10 @@ class FluxStore { hasChanged() { return this.changed; } addChangeListener(callback: () => void) { - this.emitter.on(CHANGE_EVENT, callback); + return this.emitter.addListener(CHANGE_EVENT, callback); } - removeChangeListener(callback: () => void) { - this.emitter.removeListener(CHANGE_EVENT, callback); - } - - protected cleanState() { + public cleanState() { this.changed = false; this.state = this.cleanStateFn(); } diff --git a/react-flux-babel-karma/src/stores/GreetingStore.ts b/react-flux-babel-karma/src/stores/GreetingStore.ts index 30b3251..9ea01b4 100644 --- a/react-flux-babel-karma/src/stores/GreetingStore.ts +++ b/react-flux-babel-karma/src/stores/GreetingStore.ts @@ -4,7 +4,7 @@ import GreetingState from '../types/GreetingState'; import { AddGreetingEvent, RemoveGreeting, NewGreetingChanged } from '../actions/GreetingActions'; class GreeterStore extends FluxStore { - constructor(dispatcher: Flux.Dispatcher) { + constructor(dispatcher: typeof AppDispatcher) { const onDispatch = (action: Event) => { if (action instanceof AddGreetingEvent) { const {payload} = action; diff --git a/react-flux-babel-karma/src/tsconfig.json b/react-flux-babel-karma/src/tsconfig.json deleted file mode 100644 index 2ec4842..0000000 --- a/react-flux-babel-karma/src/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compileOnSave": false, - "filesGlob": [ - "../typings/globals/**/*.*.ts", - "!../typings/globals/jasmine/index.d.ts", - "!../typings/globals/react-addons-test-utils/index.d.ts", - "**/*.{ts,tsx}" - ], - "compilerOptions": { - "jsx": "preserve", - "target": "es6", - "noImplicitAny": true, - "removeComments": false, - "preserveConstEnums": true, - "sourceMap": true - }, - "files": [ - "../typings/globals/react/index.d.ts", - "../typings/globals/react-dom/index.d.ts", - "../typings/globals/flux/index.d.ts", - "../typings/globals/node/index.d.ts", - "actions/GreetingActions.ts", - "components/App.tsx", - "components/Greeting.tsx", - "components/WhoToGreet.tsx", - "dispatcher/AppDispatcher.ts", - "main.tsx", - "stores/FluxStore.ts", - "stores/GreetingStore.ts", - "types/GreetingState.ts" - ], - "atom": { - "rewriteTsconfig": true - } -} diff --git a/react-flux-babel-karma/test/components/App.tests.tsx b/react-flux-babel-karma/test/components/App.tests.tsx index 42b1bf9..468b7da 100644 --- a/react-flux-babel-karma/test/components/App.tests.tsx +++ b/react-flux-babel-karma/test/components/App.tests.tsx @@ -1,5 +1,6 @@ -import * as React from 'react'; -import * as TestUtils from 'react-addons-test-utils'; +import React from 'react'; +import TestUtils from 'react-addons-test-utils'; + import App from '../../src/components/App'; import WhoToGreet from '../../src/components/WhoToGreet'; import Greeting from '../../src/components/Greeting'; diff --git a/react-flux-babel-karma/test/components/Greeting.tests.tsx b/react-flux-babel-karma/test/components/Greeting.tests.tsx index 9ea44b4..18a8724 100644 --- a/react-flux-babel-karma/test/components/Greeting.tests.tsx +++ b/react-flux-babel-karma/test/components/Greeting.tests.tsx @@ -1,5 +1,6 @@ -import * as React from 'react'; -import * as TestUtils from 'react-addons-test-utils'; +import React from 'react'; +import TestUtils from 'react-addons-test-utils'; + import Greeting from '../../src/components/Greeting'; import * as GreetingActions from '../../src/actions/GreetingActions'; @@ -36,7 +37,7 @@ describe('Greeting', () => { expect(GreetingActions.removeGreeting).toHaveBeenCalledWith(targetOfGreeting); }); - function render({ targetOfGreeting }) { + function render({ targetOfGreeting }: { targetOfGreeting: string; }) { const shallowRenderer = TestUtils.createRenderer(); shallowRenderer.render(); return shallowRenderer.getRenderOutput(); diff --git a/react-flux-babel-karma/test/components/WhoToGreet.tests.tsx b/react-flux-babel-karma/test/components/WhoToGreet.tests.tsx index e514ec3..47ecdd4 100644 --- a/react-flux-babel-karma/test/components/WhoToGreet.tests.tsx +++ b/react-flux-babel-karma/test/components/WhoToGreet.tests.tsx @@ -1,5 +1,6 @@ -import * as React from 'react'; -import * as TestUtils from 'react-addons-test-utils'; +import React from 'react'; +import TestUtils from 'react-addons-test-utils'; + import WhoToGreet from '../../src/components/WhoToGreet'; import * as GreetingActions from '../../src/actions/GreetingActions'; @@ -59,7 +60,7 @@ describe('WhoToGreet', () => { expect(GreetingActions.addGreeting).toHaveBeenCalledWith(newGreeting); }); - function render({ newGreeting }) { + function render({ newGreeting }: { newGreeting: string }) { const shallowRenderer = TestUtils.createRenderer(); shallowRenderer.render(); return shallowRenderer.getRenderOutput(); diff --git a/react-flux-babel-karma/test/import-babel-polyfill.js b/react-flux-babel-karma/test/import-babel-polyfill.js deleted file mode 100644 index b012711..0000000 --- a/react-flux-babel-karma/test/import-babel-polyfill.js +++ /dev/null @@ -1 +0,0 @@ -import 'babel-polyfill'; diff --git a/react-flux-babel-karma/test/main.js b/react-flux-babel-karma/test/main.js new file mode 100644 index 0000000..1b332a7 --- /dev/null +++ b/react-flux-babel-karma/test/main.js @@ -0,0 +1,5 @@ +/* eslint-disable */ +import 'babel-polyfill'; + +const testsContext = require.context('./', true, /\.tests\.ts(x?)$/); +testsContext.keys().forEach(testsContext); \ No newline at end of file diff --git a/react-flux-babel-karma/test/tsconfig.json b/react-flux-babel-karma/test/tsconfig.json deleted file mode 100644 index 8ab80b6..0000000 --- a/react-flux-babel-karma/test/tsconfig.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "compileOnSave": false, - "filesGlob": [ - "**/*.{ts,tsx}", - "../typings/globals/**/*.*.ts" - ], - "compilerOptions": { - "jsx": "preserve", - "target": "es6", - "module": "commonjs", - "noImplicitAny": true, - "preserveConstEnums": true, - "sourceMap": true - }, - "files": [ - "../typings/globals/react/index.d.ts", - "../typings/globals/react-dom/index.d.ts", - "../typings/globals/react-addons-test-utils/index.d.ts", - "../typings/globals/flux/index.d.ts", - "../typings/globals/jasmine/index.d.ts", - "../typings/globals/node/index.d.ts", - "components/App.tests.tsx", - "components/Greeting.tests.tsx", - "components/WhoToGreet.tests.tsx", - "stores/GreetingStore.tests.ts" - ], - "atom": { - "rewriteTsconfig": true - } -} diff --git a/react-flux-babel-karma/tsconfig.json b/react-flux-babel-karma/tsconfig.json new file mode 100644 index 0000000..cb31633 --- /dev/null +++ b/react-flux-babel-karma/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "lib": [ + "dom", + "es2015", + "es2016" + ], + "jsx": "preserve", + "target": "es2016", + "module": "es2015", + "moduleResolution": "node", + "noImplicitAny": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "removeComments": false, + "preserveConstEnums": true, + "sourceMap": true, + "skipLibCheck": true + } +} \ No newline at end of file diff --git a/react-flux-babel-karma/typings.json b/react-flux-babel-karma/typings.json deleted file mode 100644 index 9cd2b81..0000000 --- a/react-flux-babel-karma/typings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "es6-babel-react-flux-karma", - "version": false, - "globalDependencies": { - "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054", - "flux": "github:DefinitelyTyped/DefinitelyTyped/flux/flux.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054", - "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054", - "react": "github:DefinitelyTyped/DefinitelyTyped/react/react.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054", - "react-dom": "github:DefinitelyTyped/DefinitelyTyped/react/react-dom.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054", - "react-addons-test-utils": "github:DefinitelyTyped/DefinitelyTyped/react/react-addons-test-utils.d.ts#bcd5761826eb567876c197ccc6a87c4d05731054" - } -} From 8937d98c8529dd1f9b0363b66509bfdd7db89cda Mon Sep 17 00:00:00 2001 From: John Reilly Date: Mon, 19 Dec 2016 12:02:35 +0000 Subject: [PATCH 44/63] Update webpack.config.js --- react-flux-babel-karma/webpack.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react-flux-babel-karma/webpack.config.js b/react-flux-babel-karma/webpack.config.js index 70d955b..26a51cc 100644 --- a/react-flux-babel-karma/webpack.config.js +++ b/react-flux-babel-karma/webpack.config.js @@ -23,13 +23,13 @@ module.exports = { loaders: [{ test: /\.ts(x?)$/, exclude: /node_modules/, - loader: 'babel-loader?presets[]=es2015&presets[]=react!ts-loader' + loader: 'babel-loader?presets[]=es2016&presets[]=es2015&presets[]=react!ts-loader' }, { test: /\.js$/, exclude: /node_modules/, loader: 'babel', query: { - presets: ['es2015', 'react'] + presets: ['es2016', 'es2015', 'react'] } }] }, @@ -37,6 +37,6 @@ module.exports = { ], resolve: { // Add `.ts` and `.tsx` as a resolvable extension. - extensions: ['', '.webpack.js', '.web.js', '.ts', '.tsx', '.js'] + extensions: ['', '.ts', '.tsx', '.js'] }, }; From 466ea634bfe607e2b340ed7f99d9c18fbf2057aa Mon Sep 17 00:00:00 2001 From: Aluan Haddad Date: Sun, 25 Dec 2016 21:44:42 -0500 Subject: [PATCH 45/63] Updated jspm sample - use the latest versions of typescript and plugin-typescript - share tsconfig.json with plugin-typescript - improve style consistency --- jspm/index.html | 2 +- jspm/jspm.config.js | 243 ++++++++++++++++++++++++++++++++++++++++++-- jspm/package.json | 32 ++++-- jspm/src/app.ts | 2 +- jspm/src/greeter.ts | 16 ++- 5 files changed, 266 insertions(+), 29 deletions(-) diff --git a/jspm/index.html b/jspm/index.html index 0b6851c..83851d5 100644 --- a/jspm/index.html +++ b/jspm/index.html @@ -7,7 +7,7 @@

+ - + \ No newline at end of file diff --git a/jquery/parallax.ts b/jquery/parallax.ts index 4c81bca..8d44af9 100644 --- a/jquery/parallax.ts +++ b/jquery/parallax.ts @@ -1,5 +1,3 @@ -/// - module Parallax { export class ParallaxContainer { private content: HTMLElement; @@ -55,4 +53,4 @@ module Parallax { $(this.content).css({ marginTop: value }); } } -} +} \ No newline at end of file From 6078824dbceef6c8e2d1af691a34028ef32e616f Mon Sep 17 00:00:00 2001 From: John Reilly Date: Thu, 2 Mar 2017 06:28:42 +0000 Subject: [PATCH 47/63] updated react-flux-babel-karma to webpack 2 --- react-flux-babel-karma/gulp/webpack.js | 18 +++++----- react-flux-babel-karma/gulpFile.js | 8 ++--- react-flux-babel-karma/karma.conf.js | 1 - react-flux-babel-karma/package.json | 20 +++++------ react-flux-babel-karma/webpack.config.js | 45 ++++++++++++++++++------ 5 files changed, 57 insertions(+), 35 deletions(-) diff --git a/react-flux-babel-karma/gulp/webpack.js b/react-flux-babel-karma/gulp/webpack.js index f3cff9c..2ecbf42 100644 --- a/react-flux-babel-karma/gulp/webpack.js +++ b/react-flux-babel-karma/gulp/webpack.js @@ -10,7 +10,7 @@ var packageJson = require('../package.json'); function buildProduction(done) { // modify some webpack config options - var myProdConfig = Object.create(webpackConfig); + var myProdConfig = webpackConfig; myProdConfig.output.filename = '[name].[hash].js'; myProdConfig.plugins = myProdConfig.plugins.concat( @@ -20,8 +20,11 @@ function buildProduction(done) { } }), new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.[hash].js' }), - new webpack.optimize.DedupePlugin(), - new webpack.optimize.UglifyJsPlugin(), + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: true + } + }), failPlugin ); @@ -38,9 +41,8 @@ function buildProduction(done) { function createDevCompiler() { // modify some webpack config options - var myDevConfig = Object.create(webpackConfig); + var myDevConfig = webpackConfig; myDevConfig.devtool = 'inline-source-map'; - myDevConfig.debug = true; myDevConfig.plugins = myDevConfig.plugins.concat( new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.js' }), @@ -73,13 +75,13 @@ function watch() { }, function (err, stats) { if (err) { if (!firstBuildDone) { - firstBuildDone = true; + firstBuildDone = true; reject(err); } throw new gutil.PluginError('webpack:build-dev', err); } else { if (!firstBuildDone) { - firstBuildDone = true; + firstBuildDone = true; resolve('webpack built'); } } @@ -95,4 +97,4 @@ function watch() { module.exports = { build: function () { return build(); }, watch: function () { return watch(); } -}; \ No newline at end of file +}; diff --git a/react-flux-babel-karma/gulpFile.js b/react-flux-babel-karma/gulpFile.js index b7b3abe..0302283 100644 --- a/react-flux-babel-karma/gulpFile.js +++ b/react-flux-babel-karma/gulpFile.js @@ -16,15 +16,11 @@ gulp.task('delete-dist', function (done) { clean.run(done); }); -gulp.task('build-process.env.NODE_ENV', function () { - process.env.NODE_ENV = 'production'; -}); - -gulp.task('build-js', ['delete-dist', 'build-process.env.NODE_ENV'], function(done) { +gulp.task('build-js', ['delete-dist'], function(done) { webpack.build().then(function() { done(); }); }); -gulp.task('build-other', ['delete-dist', 'build-process.env.NODE_ENV'], function() { +gulp.task('build-other', ['delete-dist'], function() { staticFiles.build(); }); diff --git a/react-flux-babel-karma/karma.conf.js b/react-flux-babel-karma/karma.conf.js index 7257992..e43e261 100644 --- a/react-flux-babel-karma/karma.conf.js +++ b/react-flux-babel-karma/karma.conf.js @@ -26,7 +26,6 @@ module.exports = function(config) { webpack: { devtool: 'inline-source-map', - debug: true, module: webpackConfig.module, resolve: webpackConfig.resolve }, diff --git a/react-flux-babel-karma/package.json b/react-flux-babel-karma/package.json index 99168a7..ad2ce3a 100644 --- a/react-flux-babel-karma/package.json +++ b/react-flux-babel-karma/package.json @@ -1,5 +1,5 @@ { - "name": "es6-babel-react-flux-karma", + "name": "react-flux-babel-karma", "version": "1.0.0", "description": "ES6 + TypeScript + Babel + React + Karma: The Secret Recipe", "main": "index.js", @@ -14,17 +14,18 @@ "url": "git+https://github.com/microsoft/typescriptsamples.git" }, "keywords": [ - "React", - "Flux", - "ES2016", - "typescript" + "react", + "flux", + "es2016", + "typescript", + "webpack" ], "author": "John Reilly", "license": "MIT", "bugs": { "url": "https://github.com/microsoft/typescriptsamples/issues" }, - "homepage": "https://github.com/Microsoft/TypeScriptSamples/tree/master/es6-babel-react-flux-karma#readme", + "homepage": "https://github.com/Microsoft/TypeScriptSamples/tree/master/react-flux-babel-karma#readme", "devDependencies": { "@types/fbemitter": "^2.0.32", "@types/flux": "0.0.32", @@ -57,18 +58,17 @@ "gulp-util": "^3.0.6", "jasmine-core": "^2.3.4", "karma": "^1.2.0", - "karma-coverage": "^1.0.0", "karma-jasmine": "^1.0.0", "karma-junit-reporter": "^1.0.0", "karma-mocha-reporter": "^2.0.0", "karma-notify-reporter": "^1.0.0", "karma-phantomjs-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.6", - "karma-webpack": "^1.7.0", + "karma-webpack": "^2.0.2", "phantomjs-prebuilt": "^2.1.4", - "ts-loader": "^1.3.1", + "ts-loader": "^2.0.1", "typescript": "^2.1.4", - "webpack": "^1.12.2", + "webpack": "^2.2.1", "webpack-fail-plugin": "^1.0.4", "webpack-notifier": "^1.2.1" }, diff --git a/react-flux-babel-karma/webpack.config.js b/react-flux-babel-karma/webpack.config.js index 26a51cc..70f8201 100644 --- a/react-flux-babel-karma/webpack.config.js +++ b/react-flux-babel-karma/webpack.config.js @@ -3,6 +3,20 @@ var path = require('path'); + +var babelOptions = { + "presets": [ + "react", + [ + "es2015", + { + "modules": false + } + ], + "es2016" + ] +}; + module.exports = { cache: true, entry: { @@ -10,8 +24,10 @@ module.exports = { vendor: [ 'babel-polyfill', 'events', + 'fbemitter', 'flux', - 'react' + 'react', + 'react-dom' ] }, output: { @@ -20,23 +36,32 @@ module.exports = { chunkFilename: '[chunkhash].js' }, module: { - loaders: [{ + rules: [{ test: /\.ts(x?)$/, exclude: /node_modules/, - loader: 'babel-loader?presets[]=es2016&presets[]=es2015&presets[]=react!ts-loader' + use: [ + { + loader: 'babel-loader', + options: babelOptions + }, + { + loader: 'ts-loader' + } + ] }, { test: /\.js$/, exclude: /node_modules/, - loader: 'babel', - query: { - presets: ['es2016', 'es2015', 'react'] - } + use: [ + { + loader: 'babel-loader', + options: babelOptions + } + ] }] }, plugins: [ ], resolve: { - // Add `.ts` and `.tsx` as a resolvable extension. - extensions: ['', '.ts', '.tsx', '.js'] + extensions: ['.ts', '.tsx', '.js'] }, -}; +}; \ No newline at end of file From 117f827e9bb51f6fc3305234a2dea107e8844494 Mon Sep 17 00:00:00 2001 From: Ibrahim Islam Date: Mon, 24 Apr 2017 17:28:40 +0600 Subject: [PATCH 48/63] updates readme for running instructions --- jquery/README.md | 3 ++- jquery/package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/jquery/README.md b/jquery/README.md index 8e695e4..2ffaefc 100644 --- a/jquery/README.md +++ b/jquery/README.md @@ -10,6 +10,7 @@ For best results, scroll the window using the scrollbar. ## Running ``` -npm run start +npm install +tsc open parallax.html ``` diff --git a/jquery/package.json b/jquery/package.json index 98fc0c3..8fe52aa 100644 --- a/jquery/package.json +++ b/jquery/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "description": "jQuery Typescript Demo", "scripts":{ - "start": "tsc" + "tsc": "tsc" }, "dependencies": { "jquery": "^3.1.1" From d501977f1315e15b3e01e33851257b29d91d629f Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 22 Aug 2017 14:09:01 -0700 Subject: [PATCH 49/63] Update jsx sample with current react version, modern types --- jsx/README.md | 4 ++-- jsx/package.json | 10 ++++++---- jsx/require-config.js | 5 +++-- jsx/src/app.tsx | 3 ++- jsx/tsd.json | 15 --------------- 5 files changed, 13 insertions(+), 24 deletions(-) delete mode 100644 jsx/tsd.json diff --git a/jsx/README.md b/jsx/README.md index 4a7e6a5..1ab3bd1 100644 --- a/jsx/README.md +++ b/jsx/README.md @@ -10,11 +10,11 @@ npm install ## Compile ``` -node node_modules/typescript/bin/tsc +npm run build ``` ## Start http server ``` -node node_modules/http-server/bin/http-server -o +npm start ``` diff --git a/jsx/package.json b/jsx/package.json index 71552b9..6291903 100644 --- a/jsx/package.json +++ b/jsx/package.json @@ -5,9 +5,8 @@ "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "postinstall": "node_modules/.bin/tsd install", "build": "node node_modules/typescript/bin/tsc", - "run": "node node_modules/http-server/bin/http-server -o" + "start": "node node_modules/http-server/bin/http-server -o" }, "repository": { "type": "git", @@ -29,11 +28,14 @@ "devDependencies": { "typescript": "latest", "http-server": "0.8.0", - "tsd": "latest" + "@types/jquery": "^2", + "@types/react-dom": "^15", + "@types/react": "^15" }, "dependencies": { "jquery": "^2.1.4", - "react": "^0.13.3", + "react": "^15.6.1", + "react-dom": "^15.6.1", "requirejs": "^2.1.20" } } diff --git a/jsx/require-config.js b/jsx/require-config.js index a554291..27bb21c 100644 --- a/jsx/require-config.js +++ b/jsx/require-config.js @@ -1,6 +1,7 @@ requirejs.config({ paths: { - react: ['/node_modules/react/dist/react'], - jquery: ['/node_modules/jquery/dist/jquery'] + "react": ['/node_modules/react/dist/react'], + "react-dom": ['/node_modules/react-dom/dist/react-dom'], + "jquery": ['/node_modules/jquery/dist/jquery'] } }); diff --git a/jsx/src/app.tsx b/jsx/src/app.tsx index 59c717c..65c44c2 100644 --- a/jsx/src/app.tsx +++ b/jsx/src/app.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import * as ReactDOM from 'react-dom'; import * as $ from 'jquery'; import {Greeter as Greetifier, GreeterProps as GreeterProps} from 'greeter'; @@ -16,6 +17,6 @@ $(() => { whomToGreet: 'world!', }; - React.render(, $('#output').get(0)); + ReactDOM.render(, $('#output').get(0)); }); diff --git a/jsx/tsd.json b/jsx/tsd.json deleted file mode 100644 index 4cd4297..0000000 --- a/jsx/tsd.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "v4", - "repo": "borisyankov/DefinitelyTyped", - "ref": "master", - "path": "typings", - "bundle": "typings/tsd.d.ts", - "installed": { - "react/react.d.ts": { - "commit": "04a025ada3492a22df24ca2d8521c911697721b3" - }, - "jquery/jquery.d.ts": { - "commit": "04a025ada3492a22df24ca2d8521c911697721b3" - } - } -} From 1a9d4f9fdb4d45d31b8dcba2766d9d0057480017 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Mon, 22 Jan 2018 16:17:39 -0800 Subject: [PATCH 50/63] Update jquery --- jsx/package-lock.json | 13 +++++++++++++ jsx/package.json | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 jsx/package-lock.json diff --git a/jsx/package-lock.json b/jsx/package-lock.json new file mode 100644 index 0000000..5474654 --- /dev/null +++ b/jsx/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "jsx-demo", + "version": "0.0.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "jquery": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz", + "integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==" + } + } +} diff --git a/jsx/package.json b/jsx/package.json index 6291903..44629ce 100644 --- a/jsx/package.json +++ b/jsx/package.json @@ -33,7 +33,7 @@ "@types/react": "^15" }, "dependencies": { - "jquery": "^2.1.4", + "jquery": "^3.3.1", "react": "^15.6.1", "react-dom": "^15.6.1", "requirejs": "^2.1.20" From f0c91f6b3496d77099cab1d6c713583e1d96509a Mon Sep 17 00:00:00 2001 From: Gabriel Sroka Date: Sat, 11 Aug 2018 12:31:20 -0700 Subject: [PATCH 51/63] Update raytracer.ts `ctx.fillRect()` last 2 args should be width and height (not x2, y2) https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillRect will this fix https://www.typescriptlang.org/play/index.html too? --- raytracer/raytracer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raytracer/raytracer.ts b/raytracer/raytracer.ts index 450d8a5..6b15fc7 100644 --- a/raytracer/raytracer.ts +++ b/raytracer/raytracer.ts @@ -244,7 +244,7 @@ class RayTracer { var color = this.traceRay({ start: scene.camera.pos, dir: getPoint(x, y, scene.camera) }, scene, 0); var c = Color.toDrawingColor(color); ctx.fillStyle = "rgb(" + String(c.r) + ", " + String(c.g) + ", " + String(c.b) + ")"; - ctx.fillRect(x, y, x + 1, y + 1); + ctx.fillRect(x, y, 1, 1); } } } From 678b3d7cc11068e76c51d8c29cfdf75085a03ac3 Mon Sep 17 00:00:00 2001 From: Fazendaaa Date: Fri, 5 Oct 2018 23:35:47 -0300 Subject: [PATCH 52/63] First commit. --- node/.gitignore | 3 + node/HttpServer.ts | 9 - node/README.md | 57 ++- node/TcpServer.ts | 9 - node/index.ts | 18 + node/node.d.ts | 1079 --------------------------------------- node/package.json | 34 ++ node/src/APIClient.ts | 39 ++ node/src/APIServer.ts | 21 + node/src/HttpsServer.ts | 12 + node/src/TcpServer.ts | 11 + node/tsconfig.json | 66 ++- node/tslint.json | 12 + 13 files changed, 258 insertions(+), 1112 deletions(-) create mode 100644 node/.gitignore delete mode 100644 node/HttpServer.ts delete mode 100644 node/TcpServer.ts create mode 100644 node/index.ts delete mode 100644 node/node.d.ts create mode 100644 node/package.json create mode 100644 node/src/APIClient.ts create mode 100644 node/src/APIServer.ts create mode 100644 node/src/HttpsServer.ts create mode 100644 node/src/TcpServer.ts create mode 100644 node/tslint.json diff --git a/node/.gitignore b/node/.gitignore new file mode 100644 index 0000000..320c107 --- /dev/null +++ b/node/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +dist/ +package-lock.json diff --git a/node/HttpServer.ts b/node/HttpServer.ts deleted file mode 100644 index 3150405..0000000 --- a/node/HttpServer.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// -import http = require("http"); - -http.createServer(function (req, res) { - res.writeHead(200, {'Content-Type': 'text/plain'}); - res.end('Hello World\n'); -}).listen(1337, '127.0.0.1'); - -console.log('Server running at http://127.0.0.1:1337/'); \ No newline at end of file diff --git a/node/README.md b/node/README.md index 032b1e7..aee5513 100644 --- a/node/README.md +++ b/node/README.md @@ -1,18 +1,55 @@ # TypeScript Sample: Node.js +## Overview -## Overview +This sample implements a very basic [node.js](https://nodejs.org/) application using TypeScript. -This sample implements a very basic node.js application using TypeScript +## Running +First of all, install all dependencies with: +```bash +npm install +``` + +Then, you can run each of the listed [examples](#examples) with the following command: +```bash +npm run example ts example-name +``` + +To run the HTTPS server example, just: +```bash +npm run example ts HttpsServer +``` + +Under the hood, this examples are running through [ts-node](https://github.com/TypeStrong/ts-node), which is not recommended in production environments. You can also build those examples with: +```bash +npm run build +``` -## Running -For HttpServer +And then running the compiled JavaScript (JS) example file with: +```bash +npm run example js example-name ``` -tsc --sourcemap --module commonjs HttpServer.ts -node HttpServer.js + +Or even trough node directly: +```bash +node ./dist/example-name.js ``` -For TcpServer +## Examples +* [TcpServer](./src/TcpServer.ts) - a simple TCP server +* [HttpsServer](./src/HttpsServer.ts) - a simple HTTPS server +* [API Client](./src/APIClient.ts) - client that sends a "ping" +* [API Server](./src/APIServer.ts) - server the receives that "ping" and responds with a "pong" + +**note**: due to HTTP/HTTPS distinct way of handle localhost requests, in the API example, HTTP is used instead of HTTPS because is a more simple way to set it up. + +## Standards +A modified version of the [Microsoft Linter Standards](https://github.com/Microsoft/tslint-microsoft-contrib) is used. Please be mindful that they are here to help you out improve you code. + +## Git Hooks +Due to [Husky](https://github.com/typicode/husky) integration, before any push to this Github repository, [TSLint](https://github.com/palantir/tslint) will run and then point out all the fixes that needs to be done to follow the set of code [standards](#standards); if nothing needs to be corrected, you then can push it :) + +## Tests +Tests are a resourceful tool to add it, they serve as examples and also as guarantee that your code is doing what needs to be bone. [TDD](https://en.wikipedia.org/wiki/Test-driven_development) is a great example of this. +```bash +npm test ``` -tsc --sourcemap --module commonjs TcpServer.ts -node TcpServer.js -``` \ No newline at end of file diff --git a/node/TcpServer.ts b/node/TcpServer.ts deleted file mode 100644 index fea0bd4..0000000 --- a/node/TcpServer.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// -import net = require('net'); - -var server = net.createServer(function (socket) { - socket.write('Echo server\r\n'); - socket.pipe(socket); -}); - -server.listen(1337, '127.0.0.1'); diff --git a/node/index.ts b/node/index.ts new file mode 100644 index 0000000..06d7444 --- /dev/null +++ b/node/index.ts @@ -0,0 +1,18 @@ +/** + * Just running the command line program. + */ +import { ChildProcess, exec } from 'child_process'; + +const main: Function = (): ChildProcess => { + let command: string = `ts-node ./src/${process.argv[3]}.ts`; + + if (process.argv[2] === 'js') { + exec('tsc'); + + command = `node ./dist/${process.argv[3]}.js`; + } + + return exec(command); +}; + +main(); diff --git a/node/node.d.ts b/node/node.d.ts deleted file mode 100644 index 846960a..0000000 --- a/node/node.d.ts +++ /dev/null @@ -1,1079 +0,0 @@ -/************************************************ -* * -* Node.js v0.8.8 API * -* * -************************************************/ - -/************************************************ -* * -* GLOBAL * -* * -************************************************/ -declare var process: NodeProcess; -declare var global: any; - -declare var __filename: string; -declare var __dirname: string; - -declare function setTimeout(callback: () => void , ms: number): any; -declare function clearTimeout(timeoutId: any); -declare function setInterval(callback: () => void , ms: number): any; -declare function clearInterval(intervalId: any); - -declare var require: { - (id: string): any; - resolve(): string; - cache: any; - extensions: any; -} - -declare var module: { - exports: any; - require(id: string): any; - id: string; - filename: string; - loaded: boolean; - parent: any; - children: any[]; -} - -// Same as module.exports -declare var exports: any; -declare var SlowBuffer: { - new (str: string, encoding?: string): NodeBuffer; - new (size: number): NodeBuffer; - new (array: any[]): NodeBuffer; - prototype: NodeBuffer; - isBuffer(obj: any): boolean; - byteLength(string: string, encoding?: string): number; - concat(list: NodeBuffer[], totalLength?: number): NodeBuffer; -}; -declare var Buffer: { - new (str: string, encoding?: string): NodeBuffer; - new (size: number): NodeBuffer; - new (array: any[]): NodeBuffer; - prototype: NodeBuffer; - isBuffer(obj: any): boolean; - byteLength(string: string, encoding?: string): number; - concat(list: NodeBuffer[], totalLength?: number): NodeBuffer; -} - -/************************************************ -* * -* INTERFACES * -* * -************************************************/ - -declare class EventEmitter { - addListener(event: string, listener: Function); - on(event: string, listener: Function); - once(event: string, listener: Function): void; - removeListener(event: string, listener: Function): void; - removeAllListener(event: string): void; - setMaxListeners(n: number): void; - listeners(event: string): { Function; }[]; - emit(event: string, arg1?: any, arg2?: any): void; -} - -declare class WritableStream extends EventEmitter { - writable: boolean; - write(str: string, encoding?: string, fd?: string): boolean; - write(buffer: NodeBuffer): boolean; - end(): void; - end(str: string, enconding: string): void; - end(buffer: NodeBuffer): void; - destroy(): void; - destroySoon(): void; -} - -declare class ReadableStream extends EventEmitter { - readable: boolean; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - destroy(): void; - pipe(destination: WritableStream, options?: { end?: boolean; }): void; -} - -declare class NodeProcess extends EventEmitter { - stdout: WritableStream; - stderr: WritableStream; - stdin: ReadableStream; - argv: string[]; - execPath: string; - abort(): void; - chdir(directory: string): void; - cwd(): string; - env: any; - exit(code?: number): void; - getgid(): number; - setgid(id: number): void; - getuid(): number; - setuid(id: number): void; - version: string; - versions: { http_parser: string; node: string; v8: string; ares: string; uv: string; zlib: string; openssl: string; }; - config: { - target_defaults: { - cflags: any[]; - default_configuration: string; - defines: string[]; - include_dirs: string[]; - libraries: string[]; - }; - variables: { - clang: number; - host_arch: string; - node_install_npm: boolean; - node_install_waf: boolean; - node_prefix: string; - node_shared_openssl: boolean; - node_shared_v8: boolean; - node_shared_zlib: boolean; - node_use_dtrace: boolean; - node_use_etw: boolean; - node_use_openssl: boolean; - target_arch: string; - v8_no_strict_aliasing: number; - v8_use_snapshot: boolean; - visibility: string; - }; - }; - kill(pid: number, signal?: string): void; - pid: number; - title: string; - arch: string; - platform: string; - memoryUsage(): { rss: number; heapTotal; number; heapUsed: number; }; - nextTick(callback: Function): void; - umask(mask?: number): number; - uptime(): number; - hrtime(): number[]; -} - -// Buffer class -interface NodeBuffer { - [index: number]: number; - write(string: string, offset?: number, length?: number, encoding?: string): number; - toString(encoding?: string, start?: number, end?: number): string; - length: number; - copy(targetBuffer: NodeBuffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): void; - slice(start?: number, end?: number): NodeBuffer; - readUInt8(offset: number, noAsset?: boolean): number; - readUInt16LE(offset: number, noAssert?: boolean): number; - readUInt16BE(offset: number, noAssert?: boolean): number; - readUInt32LE(offset: number, noAssert?: boolean): number; - readUInt32BE(offset: number, noAssert?: boolean): number; - readInt8(offset: number, noAssert?: boolean): number; - readInt16LE(offset: number, noAssert?: boolean): number; - readInt16BE(offset: number, noAssert?: boolean): number; - readInt32LE(offset: number, noAssert?: boolean): number; - readInt32BE(offset: number, noAssert?: boolean): number; - readFloatLE(offset: number, noAssert?: boolean): number; - readFloatBE(offset: number, noAssert?: boolean): number; - readDoubleLE(offset: number, noAssert?: boolean): number; - readDoubleBE(offset: number, noAssert?: boolean): number; - writeUInt8(value: number, offset: number, noAssert?: boolean): void; - writeUInt16LE(value: number, offset: number, noAssert?: boolean): void; - writeUInt16BE(value: number, offset: number, noAssert?: boolean): void; - writeUInt32LE(value: number, offset: number, noAssert?: boolean): void; - writeUInt32BE(value: number, offset: number, noAssert?: boolean): void; - writeInt8(value: number, offset: number, noAssert?: boolean): void; - writeInt16LE(value: number, offset: number, noAssert?: boolean): void; - writeInt16BE(value: number, offset: number, noAssert?: boolean): void; - writeInt32LE(value: number, offset: number, noAssert?: boolean): void; - writeInt32BE(value: number, offset: number, noAssert?: boolean): void; - writeFloatLE(value: number, offset: number, noAssert?: boolean): void; - writeFloatBE(value: number, offset: number, noAssert?: boolean): void; - writeDoubleLE(value: number, offset: number, noAssert?: boolean): void; - writeDoubleBE(value: number, offset: number, noAssert?: boolean): void; - fill(value: any, offset?: number, end?: number): void; - INSPECT_MAX_BYTES: number; -} - -/************************************************ -* * -* MODULES * -* * -************************************************/ -declare module "querystring" { - export function stringify(obj: any, sep?: string, eq?: string): string; - export function parse(str: string, sep?: string, eq?: string, options?: { maxKeys?: number; }): any; - export function escape(): any; - export function unescape(): any; -} - -declare module "events" { - export class EventEmitter { - addListener(event: string, listener: Function); - on(event: string, listener: Function): any; - once(event: string, listener: Function): void; - removeListener(event: string, listener: Function): void; - removeAllListener(event: string): void; - setMaxListeners(n: number): void; - listeners(event: string): { Function; }[]; - emit(event: string, arg1?: any, arg2?: any): void; - } -} - -declare module "http" { - import events = require("events"); - import net = require("net"); - import stream = require("stream"); - - export class Server extends events.EventEmitter { - listen(port: number, hostname?: string, backlog?: number, callback?: Function): void; - listen(path: string, callback?: Function): void; - listen(handle: any, listeningListener?: Function): void; - close(cb?: any): void; - maxHeadersCount: number; - } - export class ServerRequest extends stream.ReadableStream { - method: string; - url: string; - headers: string; - trailers: string; - httpVersion: string; - setEncoding(encoding?: string): void; - pause(): void; - resume(): void; - connection: net.NodeSocket; - } - export class ServerResponse extends stream.WritableStream { - // Extended base methods - write(str: string, encoding?: string, fd?: string): boolean; - write(buffer: NodeBuffer): boolean; - - writeContinue(): void; - writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void; - writeHead(statusCode: number, headers?: any): void; - statusCode: number; - setHeader(name: string, value: string): void; - sendDate: boolean; - getHeader(name: string): string; - removeHeader(name: string): void; - write(chunk: any, encoding?: string): any; - addTrailers(headers: any): void; - end(data?: any, encoding?: string): void; - } - export class ClientRequest extends stream.WritableStream { - // Extended base methods - write(str: string, encoding?: string, fd?: string): boolean; - write(buffer: NodeBuffer): boolean; - - write(chunk: any, encoding?: string): void; - end(data?: any, encoding?: string): void; - abort(): void; - setTimeout(timeout: number, callback?: Function): void; - setNoDelay(noDelay?: Function): void; - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - } - export class ClientResponse extends stream.ReadableStream { - statusCode: number; - httpVersion: string; - headers: any; - trailers: any; - setEncoding(encoding?: string): void; - pause(): void; - resume(): void; - } - export interface Agent { maxSockets: number; sockets: any; requests: any; } - - export var STATUS_CODES; - export function createServer(requestListener?: (request: ServerRequest, response: ServerResponse) =>void ): Server; - export function createClient(port?: number, host?: string): any; - export function request(options: any, callback?: Function): ClientRequest; - export function get(options: any, callback?: Function): ClientRequest; - export var globalAgent: Agent; -} - -declare module "cluster" { - import child_process = require("child_process"); - - export interface ClusterSettings { - exec: string; - args: string[]; - silent: boolean; - } - export interface Worker { - id: string; - process: child_process.ChildProcess; - suicide: boolean; - send(message: any, sendHandle?: any): void; - destroy(): void; - disconnect(): void; - } - - - export var settings: ClusterSettings; - export var isMaster: boolean; - export var isWorker: boolean; - export function setupMaster(settings?: ClusterSettings): void; - export function fork(env?: any): Worker; - export function disconnect(callback?: Function): void; - export var workers: any; - - // Event emitter - export function addListener(event: string, listener: Function): void; - export function on(event: string, listener: Function): any; - export function once(event: string, listener: Function): void; - export function removeListener(event: string, listener: Function): void; - export function removeAllListener(event: string): void; - export function setMaxListeners(n: number): void; - export function listeners(event: string): { Function; }[]; - export function emit(event: string, arg1?: any, arg2?: any): void; -} - -declare module "zlib" { - import stream = require("stream"); - export interface ZlibOptions { chunkSize?: number; windowBits?: number; level?: number; memLevel?: number; strategy?: number; dictionary?: any; } - - export class Gzip extends stream.ReadWriteStream { } - export class Gunzip extends stream.ReadWriteStream { } - export class Deflate extends stream.ReadWriteStream { } - export class Inflate extends stream.ReadWriteStream { } - export class DeflateRaw extends stream.ReadWriteStream { } - export class InflateRaw extends stream.ReadWriteStream { } - export class Unzip extends stream.ReadWriteStream { } - - export function createGzip(options: ZlibOptions): Gzip; - export function createGunzip(options: ZlibOptions): Gunzip; - export function createDeflate(options: ZlibOptions): Deflate; - export function createInflate(options: ZlibOptions): Inflate; - export function createDeflateRaw(options: ZlibOptions): DeflateRaw; - export function createInflateRaw(options: ZlibOptions): InflateRaw; - export function createUnzip(options: ZlibOptions): Unzip; - - export function deflate(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; - export function deflateRaw(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; - export function gzip(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; - export function gunzip(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; - export function inflate(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; - export function inflateRaw(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; - export function unzip(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; - - // Constants - export var Z_NO_FLUSH: number; - export var Z_PARTIAL_FLUSH: number; - export var Z_SYNC_FLUSH: number; - export var Z_FULL_FLUSH: number; - export var Z_FINISH: number; - export var Z_BLOCK: number; - export var Z_TREES: number; - export var Z_OK: number; - export var Z_STREAM_END: number; - export var Z_NEED_DICT: number; - export var Z_ERRNO: number; - export var Z_STREAM_ERROR: number; - export var Z_DATA_ERROR: number; - export var Z_MEM_ERROR: number; - export var Z_BUF_ERROR: number; - export var Z_VERSION_ERROR: number; - export var Z_NO_COMPRESSION: number; - export var Z_BEST_SPEED: number; - export var Z_BEST_COMPRESSION: number; - export var Z_DEFAULT_COMPRESSION: number; - export var Z_FILTERED: number; - export var Z_HUFFMAN_ONLY: number; - export var Z_RLE: number; - export var Z_FIXED: number; - export var Z_DEFAULT_STRATEGY: number; - export var Z_BINARY: number; - export var Z_TEXT: number; - export var Z_ASCII: number; - export var Z_UNKNOWN: number; - export var Z_DEFLATED: number; - export var Z_NULL: number; -} - -declare module "os" { - export function tmpDir(): string; - export function hostname(): string; - export function type(): string; - export function platform(): string; - export function arch(): string; - export function release(): string; - export function uptime(): number; - export function loadavg(): number[]; - export function totalmem(): number; - export function freemem(): number; - export function cpus(): { model: string; speed: number; times: { user: number; nice: number; sys: number; idle: number; irq: number; }; }[]; - export function networkInterfaces(): any; - export var EOL: string; -} - -declare module "https" { - import tls = require("tls"); - import events = require("events"); - import http = require("http"); - - export interface ServerOptions { - pfx?: any; - key?: any; - passphrase?: string; - cert?: any; - ca?: any; - crl?: any; - ciphers?: string; - honorCipherOrder?: boolean; - requestCert?: boolean; - rejectUnauthorized?: boolean; - NPNProtocols?: any; - SNICallback?: (servername: string) => any; - } - - export interface RequestOptions { - host?: string; - hostname?: string; - port?: number; - path?: string; - method?: string; - headers?: any; - auth?: string; - agent?: any; - pfx?: any; - key?: any; - passphrase?: string; - cert?: any; - ca?: any; - ciphers?: string; - rejectUnauthorized?: boolean; - } - - export interface NodeAgent { - maxSockets: number; - sockets: any; - requests: any; - } - export var Agent: { - new (options?: RequestOptions): NodeAgent; - }; - export class Server extends tls.Server { } - export function createServer(options: ServerOptions, requestListener?: Function): Server; - export function request(options: RequestOptions, callback?: (res: events.EventEmitter) =>void ): http.ClientRequest; - export function get(options: RequestOptions, callback?: (res: events.EventEmitter) =>void ): http.ClientRequest; - export var globalAgent: NodeAgent; -} - -declare module "punycode" { - export function decode(string: string): string; - export function encode(string: string): string; - export function toUnicode(domain: string): string; - export function toASCII(domain: string): string; - export var ucs2: ucs2; - export interface ucs2 { - decode(string: string): string; - encode(codePoints: number[]): string; - } - export var version; -} - -declare module "repl" { - import stream = require("stream"); - import events = require("events"); - - export interface ReplOptions { - prompt?: string; - input?: stream.ReadableStream; - output?: stream.WritableStream; - terminal?: boolean; - eval?: Function; - useColors?: boolean; - useGlobal?: boolean; - ignoreUndefined?: boolean; - writer?: Function; - } - export function start(options: ReplOptions): events.EventEmitter; -} - -declare module "readline" { - import events = require("events"); - import stream = require("stream"); - - export class ReadLine extends events.EventEmitter { - setPrompt(prompt: string, length: number): void; - prompt(preserveCursor?: boolean): void; - question(query: string, callback: Function): void; - pause(): void; - resume(): void; - close(): void; - write(data: any, key?: any): void; - } - export interface ReadLineOptions { - input: stream.ReadableStream; - output: stream.WritableStream; - completer?: Function; - terminal?: boolean; - } - export function createInterface(options: ReadLineOptions): ReadLine; -} - -declare module "vm" { - export interface Context { } - export interface Script { - runInThisContext(): void; - runInNewContext(sandbox?: Context): void; - } - export function runInThisContext(code: string, filename?: string): void; - export function runInNewContext(code: string, sandbox?: Context, filename?: string): void; - export function runInContext(code: string, context: Context, filename?: string): void; - export function createContext(initSandbox?: Context): Context; - export function createScript(code: string, filename?: string): Script; -} - -declare module "child_process" { - import events = require("events"); - import stream = require("stream"); - - export class ChildProcess extends events.EventEmitter { - stdin: stream.WritableStream; - stdout: stream.ReadableStream; - stderr: stream.ReadableStream; - pid: number; - kill(signal?: string): void; - send(message: any, sendHandle: any): void; - disconnect(): void; - } - - export function spawn(command: string, args?: string[], options?: { - cwd?: string; - stdio?: any; - custom?: any; - env?: any; - detached?: boolean; - }): ChildProcess; - export function exec(command: string, options: { - cwd?: string; - stdio?: any; - customFds?: any; - env?: any; - encoding?: string; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - }, callback: (error: Error, stdout: NodeBuffer, stderr: NodeBuffer) =>void ): ChildProcess; - export function exec(command: string, callback: (error: Error, stdout: NodeBuffer, stderr: NodeBuffer) =>void ): ChildProcess; - export function execFile(file: string, args: string[], options: { - cwd?: string; - stdio?: any; - customFds?: any; - env?: any; - encoding?: string; - timeout?: number; - maxBuffer?: string; - killSignal?: string; - }, callback: (error: Error, stdout: NodeBuffer, stderr: NodeBuffer) =>void ): ChildProcess; - export function fork(modulePath: string, args?: string[], options?: { - cwd?: string; - env?: any; - encoding?: string; - }): ChildProcess; -} - -declare module "url" { - export interface Url { - href?: string; - protocol?: string; - auth?: string; - hostname?: string; - port?: string; - host?: string; - pathname?: string; - search?: string; - query?: string; - slashes?: boolean; - hash?: string; - } - - export function parse(urlStr: string, parseQueryString? , slashesDenoteHost? ): Url; - export function format(url: Url): string; - export function resolve(from: string, to: string): string; -} - -declare module "dns" { - export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) =>void ): string; - export function lookup(domain: string, callback: (err: Error, address: string, family: number) =>void ): string; - export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve4(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve6(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function reverse(ip: string, callback: (err: Error, domains: string[]) =>void ): string[]; -} - -declare module "net" { - import stream = require("stream"); - - export class NodeSocket extends stream.ReadWriteStream { - // Extended base methods - write(str: string, encoding?: string, fd?: string): boolean; - write(buffer: NodeBuffer): boolean; - - connect(port: number, host?: string, connectionListener?: Function): void; - connect(path: string, connectionListener?: Function): void; - bufferSize: number; - setEncoding(encoding?: string): void; - write(data: any, encoding?: string, callback?: Function): void; - end(data?: any, encoding?: string): void; - destroy(): void; - pause(): void; - resume(): void; - setTimeout(timeout: number, callback?: Function); void; - setNoDelay(noDelay?: boolean): void; - setKeepAlive(enable?: boolean, initialDelay?: number): void; - address(): { port: number; family: string; address: string; }; - remoteAddress: string; - remotePort: number; - bytesRead: number; - bytesWritten: number; - } - - export var Socket: { - new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): NodeSocket; - }; - - export class Server extends NodeSocket { - listen(port: number, host?: string, backlog?: number, listeningListener?: Function): void; - listen(path: string, listeningListener?: Function): void; - listen(handle: any, listeningListener?: Function): void; - close(callback?: Function): void; - address(): { port: number; family: string; address: string; }; - maxConnections: number; - connections: number; - } - export function createServer(connectionListener?: (socket: NodeSocket) =>void ): Server; - export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: NodeSocket) =>void ): Server; - export function connect(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): void; - export function connect(port: number, host?: string, connectionListener?: Function): void; - export function connect(path: string, connectionListener?: Function): void; - export function createConnection(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): void; - export function createConnection(port: number, host?: string, connectionListener?: Function): void; - export function createConnection(path: string, connectionListener?: Function): void; - export function isIP(input: string): number; - export function isIPv4(input: string): boolean; - export function isIPv6(input: string): boolean; -} - -declare module "dgram" { - import events = require("events"); - - export function createSocket(type: string, callback?: Function): Socket; - - export class Socket extends events.EventEmitter { - send(buf: NodeBuffer, offset: number, length: number, port: number, address: string, callback?: Function): void; - bind(port: number, address?: string): void; - close(): void; - address: { address: string; family: string; port: number; }; - setBroadcast(flag: boolean): void; - setMulticastTTL(ttl: number): void; - setMulticastLoopback(flag: boolean): void; - addMembership(multicastAddress: string, multicastInterface?: string): void; - dropMembership(multicastAddress: string, multicastInterface?: string): void; - } -} - -declare module "fs" { - import stream = require("stream"); - - export interface Stats { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: number; - ino: number; - mode: number; - nlink: number; - uid: number; - gid: number; - rdev: number; - size: number; - blksize: number; - blocks: number; - atime: Date; - mtime: Date; - ctime: Date; - } - - export interface FSWatcher { - close(): void; - } - - export class ReadStream extends stream.ReadableStream { } - export class WriteStream extends stream.WritableStream { } - - export function rename(oldPath: string, newPath: string, callback?: Function): void; - export function renameSync(oldPath: string, newPath: string): void; - export function truncate(fd: number, len: number, callback?: Function): void; - export function truncateSync(fd: number, len: number): void; - export function chown(path: string, uid: number, gid: number, callback?: Function): void; - export function chownSync(path: string, uid: number, gid: number): void; - export function fchown(fd: number, uid: number, gid: number, callback?: Function): void; - export function fchownSync(fd: number, uid: number, gid: number): void; - export function lchown(path: string, uid: number, gid: number, callback?: Function): void; - export function lchownSync(path: string, uid: number, gid: number): void; - export function chmod(path: string, mode: number, callback?: Function): void; - export function chmod(path: string, mode: string, callback?: Function): void; - export function chmodSync(path: string, mode: number): void; - export function chmodSync(path: string, mode: string): void; - export function fchmod(fd: number, mode: number, callback?: Function): void; - export function fchmod(fd: number, mode: string, callback?: Function): void; - export function fchmodSync(fd: number, mode: number): void; - export function fchmodSync(fd: number, mode: string): void; - export function lchmod(path: string, mode: string, callback?: Function): void; - export function lchmod(path: string, mode: number, callback?: Function): void; - export function lchmodSync(path: string, mode: number): void; - export function lchmodSync(path: string, mode: string): void; - export function stat(path: string, callback?: (err: Error, stats: Stats) =>any): Stats; - export function lstat(path: string, callback?: (err: Error, stats: Stats) =>any): Stats; - export function fstat(fd: number, callback?: (err: Error, stats: Stats) =>any): Stats; - export function statSync(path: string): Stats; - export function lstatSync(path: string): Stats; - export function fstatSync(fd: number): Stats; - export function link(srcpath: string, dstpath: string, callback?: Function): void; - export function linkSync(srcpath: string, dstpath: string): void; - export function symlink(srcpath: string, dstpath: string, type?: string, callback?: Function): void; - export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; - export function readlink(path: string, callback?: (err: Error, linkString: string) =>any): void; - export function realpath(path: string, callback?: (err: Error, resolvedPath: string) =>any): void; - export function realpath(path: string, cache: string, callback: (err: Error, resolvedPath: string) =>any): void; - export function realpathSync(path: string, cache?: string): string; - export function unlink(path: string, callback?: Function): void; - export function unlinkSync(path: string): void; - export function rmdir(path: string, callback?: Function): void; - export function rmdirSync(path: string): void; - export function mkdir(path: string, mode?: number, callback?: Function): void; - export function mkdir(path: string, mode?: string, callback?: Function): void; - export function mkdirSync(path: string, mode?: number): void; - export function mkdirSync(path: string, mode?: string): void; - export function readdir(path: string, callback?: (err: Error, files: string[]) => void): void; - export function readdirSync(path: string): string[]; - export function close(fd: number, callback?: Function): void; - export function closeSync(fd: number): void; - export function open(path: string, flags: string, mode?: string, callback?: (err: Error, fd: number) =>any): void; - export function openSync(path: string, flags: string, mode?: string): number; - export function utimes(path: string, atime: number, mtime: number, callback?: Function): void; - export function utimesSync(path: string, atime: number, mtime: number): void; - export function futimes(fd: number, atime: number, mtime: number, callback?: Function): void; - export function futimesSync(fd: number, atime: number, mtime: number): void; - export function fsync(fd: number, callback?: Function): void; - export function fsyncSync(fd: number): void; - export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) =>any): void; - export function writeSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; - export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void): void; - export function readSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; - export function readFile(filename: string, encoding: string, callback: (err: Error, data: string) => void ): void; - export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void ): void; - export function readFileSync(filename: string): NodeBuffer; - export function readFileSync(filename: string, encoding: string): string; - export function writeFile(filename: string, data: any, encoding?: string, callback?: Function): void; - export function writeFileSync(filename: string, data: any, encoding?: string): void; - export function appendFile(filename: string, data: any, encoding?: string, callback?: Function): void; - export function appendFileSync(filename: string, data: any, encoding?: string): void; - export function watchFile(filename: string, listener: { curr: Stats; prev: Stats; }): void; - export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: { curr: Stats; prev: Stats; }): void; - export function unwatchFile(filename: string, listener?: Stats): void; - export function watch(filename: string, options?: { persistent?: boolean; }, listener?: (event: string, filename: string) =>any): FSWatcher; - export function exists(path: string, callback?: (exists: boolean) =>void ): void; - export function existsSync(path: string): boolean; - export function createReadStream(path: string, options?: { - flags?: string; - encoding?: string; - fd?: string; - mode?: number; - bufferSize?: number; - }): ReadStream; - export function createWriteStream(path: string, options?: { - flags?: string; - encoding?: string; - string?: string; - }): WriteStream; -} - -declare module "path" { - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(from: string, to: string): string; - export function resolve(from: string, from2: string, to: string): string; - export function resolve(from: string, from2: string, from3: string, to: string): string; - export function resolve(from: string, from2: string, from3: string, from4: string, to: string): string; - export function resolve(from: string, from2: string, from3: string, from4: string, from5: string, to: string): string; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; -} - -declare module "string_decoder" { - export interface NodeStringDecoder { - write(buffer: NodeBuffer): string; - detectIncompleteChar(buffer: NodeBuffer): number; - } - export var StringDecoder: { - new (encoding: string): NodeStringDecoder; - }; -} - -declare module "tls" { - import crypto = require("crypto"); - import net = require("net"); - import stream = require("stream"); - - export var CLIENT_RENEG_LIMIT: number; - export var CLIENT_RENEG_WINDOW: number; - - export interface TlsOptions { - pfx?: any; //string or buffer - key?: any; //string or buffer - passphrase?: string; - cert?: any; - ca?: any; //string or buffer - crl?: any; //string or string array - ciphers?: string; - honorCipherOrder?: any; - requestCert?: boolean; - rejectUnauthorized?: boolean; - NPNProtocols?: any; //array or Buffer; - SNICallback?: (servername: string) => any; - } - - export interface ConnectionOptions { - host?: string; - port?: number; - socket?: net.NodeSocket; - pfx?: any; //string | Buffer - key?: any; //string | Buffer - passphrase?: string; - cert?: any; //string | Buffer - ca?: any; //Array of string | Buffer - rejectUnauthorized?: boolean; - NPNProtocols?: any; //Array of string | Buffer - servername?: string; - } - - export class Server extends net.Server { - // Extended base methods - listen(port: number, host?: string, backlog?: number, listeningListener?: Function): void; - listen(path: string, listeningListener?: Function): void; - listen(handle: any, listeningListener?: Function): void; - - listen(port: number, host?: string, callback?: Function): void; - close(): void; - address(): { port: number; family: string; address: string; }; - addContext(hostName: string, credentials: { - key: string; - cert: string; - ca: string; - }): void; - maxConnections: number; - connections: number; - } - - export class ClearTextStream extends stream.ReadWriteStream { - authorized: boolean; - authorizationError: Error; - getPeerCertificate(): any; - getCipher: { - name: string; - version: string; - }; - address: { - port: number; - family: string; - address: string; - }; - remoteAddress: string; - remotePort: number; - } - - export interface SecurePair { - encrypted: any; - cleartext: any; - } - - export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) =>void ): Server; - export function connect(options: TlsOptions, secureConnectionListener?: () =>void ): ClearTextStream; - export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; - export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; - export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; -} - -declare module "crypto" { - export interface CredentialDetails { - pfx: string; - key: string; - passphrase: string; - cert: string; - ca: any; //string | string array - crl: any; //string | string array - ciphers: string; - } - export interface Credentials { context?: any; } - export function createCredentials(details: CredentialDetails): Credentials; - export function createHash(algorithm: string): Hash; - export function createHmac(algorithm: string, key: string): Hmac; - export interface Hash { - update(data: any, input_encoding?: string): void; - digest(encoding?: string): string; - } - export interface Hmac { - update(data: any): void; - digest(encoding?: string): void; - } - export function createCipher(algorithm: string, password: any): Cipher; - export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; - export interface Cipher { - update(data: any, input_encoding?: string, output_encoding?: string): string; - final(output_encoding?: string): string; - setAutoPadding(auto_padding: boolean): void; - createDecipher(algorithm: string, password: any): Decipher; - createDecipheriv(algorithm: string, key: any, iv: any): Decipher; - } - export interface Decipher { - update(data: any, input_encoding?: string, output_encoding?: string): void; - final(output_encoding?: string): string; - setAutoPadding(auto_padding: boolean): void; - } - export function createSign(algorithm: string): Signer; - export interface Signer { - update(data: any): void; - sign(private_key: string, output_format: string): string; - } - export function createVerify(algorith: string): Verify; - export interface Verify { - 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; - export interface DiffieHellman { - generateKeys(encoding?: string): string; - computeSecret(other_public_key: string, input_encoding?: string, output_encoding?: string): string; - getPrime(encoding?: string): string; - getGenerator(encoding: string): string; - getPublicKey(encoding?: string): string; - getPrivateKey(encoding?: string): string; - setPublicKey(public_key: string, encoding?: string): void; - setPrivateKey(public_key: string, encoding?: string): void; - } - export function getDiffieHellman(group_name: string): DiffieHellman; - export function pbkdf2(password: string, salt: string, iterations: number, keylen: number, callback: (err: Error, derivedKey: string) => any): void; - export function randomBytes(size: number, callback?: (err: Error, buf: NodeBuffer) =>void ); -} - -declare module "stream" { - import events = require("events"); - - export interface WriteStream { - writable: boolean; - write(str: string, encoding?: string, fd?: string): boolean; - write(buffer: NodeBuffer): boolean; - end(): void; - end(str: string, enconding: string): void; - end(buffer: NodeBuffer): void; - destroy(): void; - destroySoon(): void; - } - - export class WritableStream extends events.EventEmitter implements WriteStream { - writable: boolean; - write(str: string, encoding?: string, fd?: string): boolean; - write(buffer: NodeBuffer): boolean; - end(): void; - end(str: string, enconding: string): void; - end(buffer: NodeBuffer): void; - destroy(): void; - destroySoon(): void; - } - - export class ReadableStream extends events.EventEmitter { - readable: boolean; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - destroy(): void; - pipe(destination: WriteStream, options?: { end?: boolean; }): void; - } - - export class ReadWriteStream extends events.EventEmitter implements WriteStream { - readable: boolean; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - pipe(destination: WriteStream, options?: { end?: boolean; }): void; - - writable: boolean; - write(str: string, encoding?: string, fd?: string): boolean; - write(buffer: NodeBuffer): boolean; - end(): void; - end(str: string, enconding: string): void; - end(buffer: NodeBuffer): void; - destroy(): void; - destroySoon(): void; - } -} - -declare module "util" { - export function format(format: any, ...param: any[]): string; - export function debug(string: string): void; - export function error(...param: any[]): void; - export function puts(...param: any[]): void; - export function print(...param: any[]): void; - export function log(string: string): void; - export function inspect(object: any, showHidden?: boolean, depth?: number, color?: boolean): void; - export function isArray(object: any): boolean; - export function isRegExp(object: any): boolean; - export function isDate(object: any): boolean; - export function isError(object: any): boolean; - export function inherits(constructor: any, superConstructor: any): void; -} - -declare module "assert" { - export function fail(actual: any, expected: any, message: string, operator: string): void; - export function assert(value: any, message: string): void; - export function ok(value: any, message?: string): void; - export function equal(actual: any, expected: any, message?: string): void; - export function notEqual(actual: any, expected: any, message?: string): void; - export function deepEqual(actual: any, expected: any, message?: string): void; - export function notDeepEqual(acutal: any, expected: any, message?: string): void; - export function strictEqual(actual: any, expected: any, message?: string): void; - export function notStrictEqual(actual: any, expected: any, message?: string): void; - export function throws(block: any, error?: any, messsage?: string): void; - export function doesNotThrow(block: any, error?: any, messsage?: string): void; - export function ifError(value: any): void; -} - -declare module "tty" { - import net = require("net"); - - export function isatty(fd: string): boolean; - export class ReadStream extends net.NodeSocket { - isRaw: boolean; - setRawMode(mode: boolean): void; - } - export class WriteStream extends net.NodeSocket { - columns: number; - rows: number; - } -} - -declare module "domain" { - import events = require("events"); - - export class Domain extends events.EventEmitter { } - - export function create(): Domain; - export function run(fn: Function): void; - export function add(emitter: events.EventEmitter): void; - export function remove(emitter: events.EventEmitter): void; - export function bind(cb: (er: Error, data: any) =>any): any; - export function intercept(cb: (data: any) => any): any; - export function dispose(): void; -} \ No newline at end of file diff --git a/node/package.json b/node/package.json new file mode 100644 index 0000000..b2b2d97 --- /dev/null +++ b/node/package.json @@ -0,0 +1,34 @@ +{ + "name": "node", + "version": "1.0.0", + "description": "Node examples using TypeScript", + "scripts": { + "build": "tsc", + "example": "ts-node ./index.ts", + "lint": "tslint --config tslint.json --project .", + "test": "jest --config jest.config.json --ci --runInBand --detectOpenHandles --forceExit --no-cache" + }, + "contributors": [ + { + "name": "Mohamed Hegazy", + "url": "https://github.com/mhegazy" + }, + { + "name": "Lucas de Almeida Carotta", + "url": "https://github.com/Fazendaaa" + } + ], + "devDependencies": { + "@types/node": "^10.11.4", + "ts-node": "^7.0.1", + "tslint": "^5.11.0", + "tslint-microsoft-contrib": "^5.2.1", + "typescript": "^3.1.1" + }, + "husky": { + "hooks": { + "pre-push": "npm run lint" + } + }, + "dependencies": {} +} diff --git a/node/src/APIClient.ts b/node/src/APIClient.ts new file mode 100644 index 0000000..d1c9489 --- /dev/null +++ b/node/src/APIClient.ts @@ -0,0 +1,39 @@ +/** + * API client example. + */ +import { IncomingMessage, request } from 'http'; + +const handleResponse = (resolve: (data: string) => void, reject: (data: Error) => void, response: IncomingMessage): void => { + let chunk = ''; + const { statusCode } = response; + + if (statusCode !== 200) { + reject(new Error('Server error')); + } + + response.setEncoding('utf8') + .on('error', reject) + .on('uncaughtException', reject) + .on('data', (data: string) => chunk += data) + .on('end', () => resolve(chunk)); +}; + +const ping = (): Promise => new Promise((resolve: (data: string) => void, reject: (data: Error) => void) => { + const post = request({ + path: '/', + port: 8080, + method: 'GET', + hostname: 'localhost', + headers: { + 'Content-Type': 'text/plain' + } + }); + const curriedHandleResponse = ((response: IncomingMessage) => handleResponse(resolve, reject, response)); + + post.write('ping'); + post.on('response', curriedHandleResponse); + post.on('error', () => reject(new Error('Request error'))); + post.end(); +}); + +ping().then(console.log).catch(console.error); diff --git a/node/src/APIServer.ts b/node/src/APIServer.ts new file mode 100644 index 0000000..e2a1dc0 --- /dev/null +++ b/node/src/APIServer.ts @@ -0,0 +1,21 @@ +/** + * API example server. + */ +import { createServer, IncomingMessage, ServerResponse } from 'http'; + +const server = createServer((sent: IncomingMessage, res: ServerResponse) => { + const body = []; + + sent.on('data', (data: Buffer) => body.push(data)); + sent.on('error', (err) => console.error(err)); + sent.on('end', () => { + const message = Buffer.concat(body).toString(); + + console.log(message); + }); + + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end('pong'); +}); + +server.listen(8080, 'localhost', () => console.table('Server running at https://localhost:8080/')); diff --git a/node/src/HttpsServer.ts b/node/src/HttpsServer.ts new file mode 100644 index 0000000..cb7b044 --- /dev/null +++ b/node/src/HttpsServer.ts @@ -0,0 +1,12 @@ +/** + * HTTPS server example. + */ +import { IncomingMessage, ServerResponse } from 'http'; +import { createServer } from 'https'; + +const server = createServer({}, (_: IncomingMessage, res: ServerResponse) => { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end('Hello World\n'); +}); + +server.listen(1337, '127.0.0.1', () => console.log('Server running at http://127.0.0.1:1337/')); diff --git a/node/src/TcpServer.ts b/node/src/TcpServer.ts new file mode 100644 index 0000000..0d71ceb --- /dev/null +++ b/node/src/TcpServer.ts @@ -0,0 +1,11 @@ +/** + * TCP server example. + */ +import { createServer, Socket } from 'net'; + +const server = createServer((socket: Socket) => { + socket.write('Echo server\r\n'); + socket.pipe(socket); +}); + +server.listen(1337, '127.0.0.1', () => console.log('Server running at http://127.0.0.1:1337/')); diff --git a/node/tsconfig.json b/node/tsconfig.json index f955121..f7fc400 100644 --- a/node/tsconfig.json +++ b/node/tsconfig.json @@ -1,6 +1,62 @@ { - "compilerOptions": { - "module": "commonjs", - "sourceMap": true - } -} \ No newline at end of file + "compilerOptions": { + /* Basic Options */ + "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + // "lib": [], /* Specify library files to be included in the compilation. */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + "outDir": "./dist", /* Redirect output structure to the directory. */ + "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "composite": true, /* Enable project compilation */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + + /* Strict Type-Checking Options */ + "strict": true, /* Enable all strict type-checking options. */ + "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + "strictNullChecks": true, /* Enable strict null checks. */ + "strictFunctionTypes": true, /* Enable strict checking of function types. */ + "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + "noUnusedLocals": true, /* Report errors on unused locals. */ + "noUnusedParameters": true, /* Report errors on unused parameters. */ + "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + "baseUrl": "./src", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + }, + "exclude": [ + "./index.ts" + ] +} diff --git a/node/tslint.json b/node/tslint.json new file mode 100644 index 0000000..39a8b28 --- /dev/null +++ b/node/tslint.json @@ -0,0 +1,12 @@ +{ + "defaultSeverity": "error", + "extends": [ + "tslint-microsoft-contrib" + ], + "jsRules": {}, + "rules": { + "typedef": false, + "no-console": false + }, + "rulesDirectory": [] +} From ad4118fe41ddbe667ea53c05177b8a0252828ca7 Mon Sep 17 00:00:00 2001 From: Ryan Braganza Date: Sat, 13 Oct 2018 14:30:47 +1100 Subject: [PATCH 53/63] Add a package.json file to run the TodoMVC example fix Microsoft/TypeScriptSamples/#146 --- todomvc/.gitignore | 2 ++ todomvc/README.md | 4 ++-- todomvc/package.json | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 todomvc/.gitignore create mode 100644 todomvc/package.json diff --git a/todomvc/.gitignore b/todomvc/.gitignore new file mode 100644 index 0000000..38f2474 --- /dev/null +++ b/todomvc/.gitignore @@ -0,0 +1,2 @@ +js/*.js +js/*.js.map diff --git a/todomvc/README.md b/todomvc/README.md index 5210584..969ea93 100644 --- a/todomvc/README.md +++ b/todomvc/README.md @@ -11,8 +11,8 @@ TypeScript integration points are highlighted: ## Running ``` -tsc --sourcemap js\todos.ts -start index.html +npm install +npm start ``` ## Caveats diff --git a/todomvc/package.json b/todomvc/package.json new file mode 100644 index 0000000..f16a933 --- /dev/null +++ b/todomvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "typescript-todomvc", + "version": "1.0.0", + "description": "TodoMVC/TypeScript demo", + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/TypeScriptSamples.git" + }, + "dependencies": { + "http-server": "^0.11.1" + }, + "devDependencies": { + "typescript": "^3.0.0" + }, + "scripts": { + "start": "tsc && http-server -o" + } +} From 3f5ab1a1f1517c04babbba6d1cf1e6a16249ca71 Mon Sep 17 00:00:00 2001 From: Fazendaaa Date: Tue, 23 Oct 2018 00:06:38 -0300 Subject: [PATCH 54/63] Adding new examples ideas. --- node/README.md | 9 ++++++--- node/src/APIClient.ts | 8 ++++---- node/src/APIServer.ts | 4 ++-- node/src/HttpServer.ts | 14 ++++++++++++++ node/src/HttpsServer.ts | 12 ------------ node/src/TcpServer.ts | 5 ++++- node/src/WebScrapping.ts | 0 node/src/Wikipedia.ts | 0 node/src/WordCounter.ts | 0 9 files changed, 30 insertions(+), 22 deletions(-) create mode 100644 node/src/HttpServer.ts delete mode 100644 node/src/HttpsServer.ts create mode 100644 node/src/WebScrapping.ts create mode 100644 node/src/Wikipedia.ts create mode 100644 node/src/WordCounter.ts diff --git a/node/README.md b/node/README.md index aee5513..9c19ef7 100644 --- a/node/README.md +++ b/node/README.md @@ -16,7 +16,7 @@ npm run example ts example-name To run the HTTPS server example, just: ```bash -npm run example ts HttpsServer +npm run example ts HttpServer ``` Under the hood, this examples are running through [ts-node](https://github.com/TypeStrong/ts-node), which is not recommended in production environments. You can also build those examples with: @@ -36,11 +36,14 @@ node ./dist/example-name.js ## Examples * [TcpServer](./src/TcpServer.ts) - a simple TCP server -* [HttpsServer](./src/HttpsServer.ts) - a simple HTTPS server +* [HttpServer](./src/HttpServer.ts) - a simple HTTPS server * [API Client](./src/APIClient.ts) - client that sends a "ping" * [API Server](./src/APIServer.ts) - server the receives that "ping" and responds with a "pong" +* [Word counter](./src/WordCounter.ts) - shows how many of the desired words are presented in a file +* [Wikipedia Search](./src/Wikipedia.ts) - searches the [Wikipedia](https://en.wikipedia.org/w/api.php?) website +* [Web Scrapping](./src/WebScrapping.ts) - make a web scrapping in the [webscraper.io](https://www.webscraper.io/test-sites/e-commerce/static), pagination included -**note**: due to HTTP/HTTPS distinct way of handle localhost requests, in the API example, HTTP is used instead of HTTPS because is a more simple way to set it up. +**note**: due to HTTP/HTTPS distinct way of handle localhost requests, in the examples HTTP is used instead of HTTPS because is a more easy way to set it up. ## Standards A modified version of the [Microsoft Linter Standards](https://github.com/Microsoft/tslint-microsoft-contrib) is used. Please be mindful that they are here to help you out improve you code. diff --git a/node/src/APIClient.ts b/node/src/APIClient.ts index d1c9489..84a8ef7 100644 --- a/node/src/APIClient.ts +++ b/node/src/APIClient.ts @@ -15,10 +15,10 @@ const handleResponse = (resolve: (data: string) => void, reject: (data: Error) = .on('error', reject) .on('uncaughtException', reject) .on('data', (data: string) => chunk += data) - .on('end', () => resolve(chunk)); + .on('end', () => { resolve(chunk); }); }; -const ping = (): Promise => new Promise((resolve: (data: string) => void, reject: (data: Error) => void) => { +const ping = async (): Promise => new Promise((resolve: (data: string) => void, reject: (data: Error) => void) => { const post = request({ path: '/', port: 8080, @@ -28,11 +28,11 @@ const ping = (): Promise => new Promise((resolve: (data: string) => void 'Content-Type': 'text/plain' } }); - const curriedHandleResponse = ((response: IncomingMessage) => handleResponse(resolve, reject, response)); + const curriedHandleResponse = ((response: IncomingMessage) => { handleResponse(resolve, reject, response); }); post.write('ping'); post.on('response', curriedHandleResponse); - post.on('error', () => reject(new Error('Request error'))); + post.on('error', () => { reject(new Error('Request error')); }); post.end(); }); diff --git a/node/src/APIServer.ts b/node/src/APIServer.ts index e2a1dc0..38fe4d3 100644 --- a/node/src/APIServer.ts +++ b/node/src/APIServer.ts @@ -7,7 +7,7 @@ const server = createServer((sent: IncomingMessage, res: ServerResponse) => { const body = []; sent.on('data', (data: Buffer) => body.push(data)); - sent.on('error', (err) => console.error(err)); + sent.on('error', (err) => { console.error(err); }); sent.on('end', () => { const message = Buffer.concat(body).toString(); @@ -18,4 +18,4 @@ const server = createServer((sent: IncomingMessage, res: ServerResponse) => { res.end('pong'); }); -server.listen(8080, 'localhost', () => console.table('Server running at https://localhost:8080/')); +server.listen(8080, 'localhost', () => { console.log('Server running at https://localhost:8080/'); }); diff --git a/node/src/HttpServer.ts b/node/src/HttpServer.ts new file mode 100644 index 0000000..9f55352 --- /dev/null +++ b/node/src/HttpServer.ts @@ -0,0 +1,14 @@ +/** + * HTTPS server example. + */ +import { createServer, IncomingMessage, ServerResponse } from 'http'; + +const host = 'localhost'; +const port = 1337; + +const server = createServer((_: IncomingMessage, res: ServerResponse) => { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end('Hello World\n'); +}); + +server.listen(port, host, () => { console.log(`Server running at ${host}:${port}`); }); diff --git a/node/src/HttpsServer.ts b/node/src/HttpsServer.ts deleted file mode 100644 index cb7b044..0000000 --- a/node/src/HttpsServer.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * HTTPS server example. - */ -import { IncomingMessage, ServerResponse } from 'http'; -import { createServer } from 'https'; - -const server = createServer({}, (_: IncomingMessage, res: ServerResponse) => { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end('Hello World\n'); -}); - -server.listen(1337, '127.0.0.1', () => console.log('Server running at http://127.0.0.1:1337/')); diff --git a/node/src/TcpServer.ts b/node/src/TcpServer.ts index 0d71ceb..d72bcfa 100644 --- a/node/src/TcpServer.ts +++ b/node/src/TcpServer.ts @@ -3,9 +3,12 @@ */ import { createServer, Socket } from 'net'; +const host = 'localhost'; +const port = 1337; + const server = createServer((socket: Socket) => { socket.write('Echo server\r\n'); socket.pipe(socket); }); -server.listen(1337, '127.0.0.1', () => console.log('Server running at http://127.0.0.1:1337/')); +server.listen(port, host, () => { console.log(`Server running at ${host}:${port}`); }); diff --git a/node/src/WebScrapping.ts b/node/src/WebScrapping.ts new file mode 100644 index 0000000..e69de29 diff --git a/node/src/Wikipedia.ts b/node/src/Wikipedia.ts new file mode 100644 index 0000000..e69de29 diff --git a/node/src/WordCounter.ts b/node/src/WordCounter.ts new file mode 100644 index 0000000..e69de29 From 74bfd9e6650df0c260c5b5e4718fc0a212254368 Mon Sep 17 00:00:00 2001 From: Fazendaaa Date: Tue, 23 Oct 2018 11:48:15 -0300 Subject: [PATCH 55/63] Adding Wikipedia and Word Counter. --- node/README.md | 19 ++++--------------- node/lorem.txt | 1 + node/package.json | 4 +--- node/src/Wikipedia.ts | 41 +++++++++++++++++++++++++++++++++++++++++ node/src/WordCounter.ts | 13 +++++++++++++ 5 files changed, 60 insertions(+), 18 deletions(-) create mode 100644 node/lorem.txt diff --git a/node/README.md b/node/README.md index 9c19ef7..afee801 100644 --- a/node/README.md +++ b/node/README.md @@ -9,28 +9,23 @@ First of all, install all dependencies with: npm install ``` -Then, you can run each of the listed [examples](#examples) with the following command: +Then, you can run each of the listed [examples](#examples) with the following command from the this project root folder: ```bash -npm run example ts example-name +ts-node ./examples/example-name.ts ``` To run the HTTPS server example, just: ```bash -npm run example ts HttpServer +ts-node ./examples/HttpServer.ts ``` -Under the hood, this examples are running through [ts-node](https://github.com/TypeStrong/ts-node), which is not recommended in production environments. You can also build those examples with: +This examples are running through [ts-node](https://github.com/TypeStrong/ts-node), which is not recommended in production environments. You can also build those examples with: ```bash npm run build ``` And then running the compiled JavaScript (JS) example file with: ```bash -npm run example js example-name -``` - -Or even trough node directly: -```bash node ./dist/example-name.js ``` @@ -50,9 +45,3 @@ A modified version of the [Microsoft Linter Standards](https://github.com/Micros ## Git Hooks Due to [Husky](https://github.com/typicode/husky) integration, before any push to this Github repository, [TSLint](https://github.com/palantir/tslint) will run and then point out all the fixes that needs to be done to follow the set of code [standards](#standards); if nothing needs to be corrected, you then can push it :) - -## Tests -Tests are a resourceful tool to add it, they serve as examples and also as guarantee that your code is doing what needs to be bone. [TDD](https://en.wikipedia.org/wiki/Test-driven_development) is a great example of this. -```bash -npm test -``` diff --git a/node/lorem.txt b/node/lorem.txt new file mode 100644 index 0000000..92fb55f --- /dev/null +++ b/node/lorem.txt @@ -0,0 +1 @@ +"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?" diff --git a/node/package.json b/node/package.json index b2b2d97..8438908 100644 --- a/node/package.json +++ b/node/package.json @@ -4,9 +4,7 @@ "description": "Node examples using TypeScript", "scripts": { "build": "tsc", - "example": "ts-node ./index.ts", - "lint": "tslint --config tslint.json --project .", - "test": "jest --config jest.config.json --ci --runInBand --detectOpenHandles --forceExit --no-cache" + "lint": "tslint --config tslint.json --project ." }, "contributors": [ { diff --git a/node/src/Wikipedia.ts b/node/src/Wikipedia.ts index e69de29..bbd76a9 100644 --- a/node/src/Wikipedia.ts +++ b/node/src/Wikipedia.ts @@ -0,0 +1,41 @@ +/** + * Searches Wikipedia database + */ +import { IncomingMessage } from 'http'; +import { request } from 'https'; + +const response = (res: IncomingMessage) => { + const { statusCode } = res; + let chunk = ''; + + if (statusCode !== 200) { + console.error(new Error(`[Request status ${statusCode}] Not accepted`)); + } else { + res.on('error', console.error) + .on('uncaughtException', console.error) + .on('data', (data: string) => chunk += data) + .on('end', () => { + const result = JSON.parse(chunk); + + console.log(result); + }); + } +}; + +const search = 'microsoft'; +const query = `action=query&format=json&list=search&srsearch=${encodeURI(search)}`; +const path = `/w/api.php?${query}`; +const options = { + path, + method: 'GET', + hostname: 'en.wikipedia.org', + headers: { + Accept: 'application/json', + 'Content-Type': 'text/html' + } +}; +const wikipedia = request(options); + +wikipedia.on('error', console.error) + .on('response', response) + .end(); diff --git a/node/src/WordCounter.ts b/node/src/WordCounter.ts index e69de29..a49dfa2 100644 --- a/node/src/WordCounter.ts +++ b/node/src/WordCounter.ts @@ -0,0 +1,13 @@ +/** + * Reads file then shows how many matching occurrences of a word is found + */ +import { readFileSync } from 'fs'; +import { join } from 'path'; + +const path = join(__dirname, '../lorem.txt'); +const ipsum = readFileSync(path, { encoding: 'utf8' }); +const word = 'ut'; +const re = new RegExp(word, 'gm'); +const matching = ipsum.match(re); + +console.log(`Number of occurrences of the \"${word}\" word is: ${matching.length}`); From 1f8ccfe2b8a9176079ca29670d18d51ae21e1c55 Mon Sep 17 00:00:00 2001 From: Fazendaaa Date: Tue, 23 Oct 2018 21:40:32 -0300 Subject: [PATCH 56/63] Removing Web Scrapping. --- node/README.md | 1 - node/src/WebScrapping.ts | 0 2 files changed, 1 deletion(-) delete mode 100644 node/src/WebScrapping.ts diff --git a/node/README.md b/node/README.md index afee801..ec0e9b3 100644 --- a/node/README.md +++ b/node/README.md @@ -36,7 +36,6 @@ node ./dist/example-name.js * [API Server](./src/APIServer.ts) - server the receives that "ping" and responds with a "pong" * [Word counter](./src/WordCounter.ts) - shows how many of the desired words are presented in a file * [Wikipedia Search](./src/Wikipedia.ts) - searches the [Wikipedia](https://en.wikipedia.org/w/api.php?) website -* [Web Scrapping](./src/WebScrapping.ts) - make a web scrapping in the [webscraper.io](https://www.webscraper.io/test-sites/e-commerce/static), pagination included **note**: due to HTTP/HTTPS distinct way of handle localhost requests, in the examples HTTP is used instead of HTTPS because is a more easy way to set it up. diff --git a/node/src/WebScrapping.ts b/node/src/WebScrapping.ts deleted file mode 100644 index e69de29..0000000 From e190f5accde0d7bd7125ce6e9b6f0e6645fb35ce Mon Sep 17 00:00:00 2001 From: Josiah Nunemaker Date: Thu, 25 Oct 2018 20:17:38 -0400 Subject: [PATCH 57/63] Remove jQuery dependancy in JSX demo to simplify example --- jsx/package.json | 2 -- jsx/src/app.tsx | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/jsx/package.json b/jsx/package.json index 44629ce..8c62110 100644 --- a/jsx/package.json +++ b/jsx/package.json @@ -28,12 +28,10 @@ "devDependencies": { "typescript": "latest", "http-server": "0.8.0", - "@types/jquery": "^2", "@types/react-dom": "^15", "@types/react": "^15" }, "dependencies": { - "jquery": "^3.3.1", "react": "^15.6.1", "react-dom": "^15.6.1", "requirejs": "^2.1.20" diff --git a/jsx/src/app.tsx b/jsx/src/app.tsx index 65c44c2..13a5613 100644 --- a/jsx/src/app.tsx +++ b/jsx/src/app.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import * as $ from 'jquery'; import {Greeter as Greetifier, GreeterProps as GreeterProps} from 'greeter'; function getRandomGreeting() { @@ -12,11 +11,11 @@ function getRandomGreeting() { } } -$(() => { +(() => { let props: GreeterProps = { whomToGreet: 'world!', }; ReactDOM.render(, $('#output').get(0)); -}); +})(); From 41489179e9064c876500f1b1e6dc0bc52afceba6 Mon Sep 17 00:00:00 2001 From: Reltre Date: Fri, 26 Oct 2018 14:17:52 -0700 Subject: [PATCH 58/63] Add tsconfig which allows javascript files. --- js-and-ts/tsconfig.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 js-and-ts/tsconfig.json diff --git a/js-and-ts/tsconfig.json b/js-and-ts/tsconfig.json new file mode 100644 index 0000000..2a9bebf --- /dev/null +++ b/js-and-ts/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "outDir": "./built", + "sourceMap": true, + "allowJs": true, + "target": "es6" + }, + "include": [ + "./**/*" + ] +} \ No newline at end of file From f0db5e7a9c3374f66728c7bfecc008111891fbf9 Mon Sep 17 00:00:00 2001 From: Reltre Date: Fri, 26 Oct 2018 14:18:23 -0700 Subject: [PATCH 59/63] Create simple class which requires an existing js module. --- js-and-ts/robot.ts | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 js-and-ts/robot.ts diff --git a/js-and-ts/robot.ts b/js-and-ts/robot.ts new file mode 100644 index 0000000..611a076 --- /dev/null +++ b/js-and-ts/robot.ts @@ -0,0 +1,40 @@ +// This import wouldn't be possible without the allowJS option in tsconfig +import { Formatter } from './format.js'; + +interface Robot { + name: String, + currentComputation: Number +} + +class Robot { + constructor(public name: String) { + this.name = name; + this.currentComputation = 0; + } + + // Given a mathematical operation, return a value based on the value passed, + // the operation and the number 10 + compute(operation, value) { + let computedValue = 0; + switch(operation) { + case '+': + computedValue = value + 10 + case '-': + computedValue = value - 10 + case '/': + computedValue = value / 10 + case '*': + computedValue = value * 10 + } + this.currentComputation = computedValue; + } + + // Using an external JS module, format the computed value from our robot + displayCurrentComputation() { + console.log(Formatter.surroundWithStars(this.currentComputation)); + } +} + +const hal = new Robot('Hal'); +hal.compute('+', 32); +hal.displayCurrentComputation(); \ No newline at end of file From e3b5661a5af713ce09215f4aca24454caec87bc2 Mon Sep 17 00:00:00 2001 From: Reltre Date: Fri, 26 Oct 2018 14:19:12 -0700 Subject: [PATCH 60/63] A simple module, to be used as a mixin to a ts file. --- js-and-ts/format.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 js-and-ts/format.js diff --git a/js-and-ts/format.js b/js-and-ts/format.js new file mode 100644 index 0000000..9b6ebd7 --- /dev/null +++ b/js-and-ts/format.js @@ -0,0 +1,13 @@ +const surroundWithStars = (value) => { + const valueLength = value.toString().length; + const topBottomBorder = '*'.repeat(valueLength + 2); + + return topBottomBorder + + "\n" + + '*' + value.toString() + '*' + + "\n" + + topBottomBorder; +} + +module.exports.Formatter = { surroundWithStars }; + From f0bc0f2eba9b320650d06f97864daca5e7495e5c Mon Sep 17 00:00:00 2001 From: Reltre Date: Fri, 26 Oct 2018 14:38:18 -0700 Subject: [PATCH 61/63] Fix issues in robot class. --- js-and-ts/robot.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/js-and-ts/robot.ts b/js-and-ts/robot.ts index 611a076..0542c12 100644 --- a/js-and-ts/robot.ts +++ b/js-and-ts/robot.ts @@ -2,8 +2,8 @@ import { Formatter } from './format.js'; interface Robot { - name: String, - currentComputation: Number + name: String; + currentComputation: Number; } class Robot { @@ -18,13 +18,19 @@ class Robot { let computedValue = 0; switch(operation) { case '+': - computedValue = value + 10 + computedValue = value + 10; + break; case '-': - computedValue = value - 10 + computedValue = value - 10; + break; case '/': - computedValue = value / 10 + computedValue = value / 10; + break; case '*': - computedValue = value * 10 + computedValue = value * 10; + break; + default: + console.log("Does not compute!!") } this.currentComputation = computedValue; } From 89f7608ee91c2de1117bbf382ba83b74c547d3ca Mon Sep 17 00:00:00 2001 From: Reltre Date: Fri, 26 Oct 2018 14:38:52 -0700 Subject: [PATCH 62/63] Add readme to 'ts-and-js' sample folder. --- js-and-ts/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 js-and-ts/README.md diff --git a/js-and-ts/README.md b/js-and-ts/README.md new file mode 100644 index 0000000..2b3ecfb --- /dev/null +++ b/js-and-ts/README.md @@ -0,0 +1,17 @@ +# TypeScript Sample: Mixing TypeScript and JavaScript + +## Overview + +A sample of how to use the `allowJS` option to use both JavaScript and TypeScript together. +A simple text formatter is provided, written in JavaScript. This formatter is then used +within a TypeScript class to format a computation. + +To run this sample, you must have `node` installed. You can also use `ts-node` to run this directly +without a compilation from TypeScript to JavaScript. + +## Running + +```bash +$ tsc robot.ts` +$ node robot.js` +``` \ No newline at end of file From 661574a05cb3eba10a39d9a6ac510dd5e61b5464 Mon Sep 17 00:00:00 2001 From: Marcin Biernacik Date: Fri, 26 Oct 2018 23:59:59 +0200 Subject: [PATCH 63/63] Updated AngularJS example to ES6 + cleanups --- angular1/app/app.ts | 8 ++--- .../components/version/interpolate-filter.ts | 9 ++---- .../version/interpolate-filter_test.ts | 8 ++--- .../components/version/version-directive.ts | 11 +++---- .../version/version-directive_test.ts | 13 ++++---- angular1/app/components/version/version.ts | 1 - .../app/components/version/version_test.ts | 6 ++-- angular1/app/view1/view1.ts | 23 ++++++------- angular1/app/view1/view1_test.ts | 12 +++---- angular1/app/view2/view2.ts | 23 ++++++------- angular1/app/view2/view2_test.ts | 12 +++---- angular1/e2e-tests/scenarios.ts | 32 ++++++------------- 12 files changed, 62 insertions(+), 96 deletions(-) diff --git a/angular1/app/app.ts b/angular1/app/app.ts index 21eccdb..68fd66c 100644 --- a/angular1/app/app.ts +++ b/angular1/app/app.ts @@ -6,7 +6,7 @@ angular.module('myApp', [ 'myApp.view1', 'myApp.view2', 'myApp.version' -]). -config(['$routeProvider', function($routeProvider) { - $routeProvider.otherwise({redirectTo: '/view1'}); -}]); +]) + .config(['$routeProvider', $routeProvider => { + $routeProvider.otherwise({ redirectTo: '/view1' }); + }]); diff --git a/angular1/app/components/version/interpolate-filter.ts b/angular1/app/components/version/interpolate-filter.ts index 03bb198..91a4198 100644 --- a/angular1/app/components/version/interpolate-filter.ts +++ b/angular1/app/components/version/interpolate-filter.ts @@ -1,9 +1,6 @@ 'use strict'; angular.module('myApp.version.interpolate-filter', []) - -.filter('interpolate', ['version', function(version) { - return function(text) { - return String(text).replace(/\%VERSION\%/mg, version); - }; -}]); + .filter('interpolate', ['version', version => { + return text => String(text).replace(/\%VERSION\%/mg, version); + }]); diff --git a/angular1/app/components/version/interpolate-filter_test.ts b/angular1/app/components/version/interpolate-filter_test.ts index ff56c52..c4b060f 100644 --- a/angular1/app/components/version/interpolate-filter_test.ts +++ b/angular1/app/components/version/interpolate-filter_test.ts @@ -1,14 +1,14 @@ 'use strict'; -describe('myApp.version module', function() { +describe('myApp.version module', () => { beforeEach(module('myApp.version')); - describe('interpolate filter', function() { - beforeEach(module(function($provide) { + describe('interpolate filter', () => { + beforeEach(module($provide => { $provide.value('version', 'TEST_VER'); })); - it('should replace VERSION', inject(function(interpolateFilter) { + it('should replace VERSION', inject(interpolateFilter => { expect(interpolateFilter('before %VERSION% after')).toEqual('before TEST_VER after'); })); }); diff --git a/angular1/app/components/version/version-directive.ts b/angular1/app/components/version/version-directive.ts index 74088f8..deb07d0 100644 --- a/angular1/app/components/version/version-directive.ts +++ b/angular1/app/components/version/version-directive.ts @@ -1,9 +1,8 @@ 'use strict'; angular.module('myApp.version.version-directive', []) - -.directive('appVersion', ['version', function(version) { - return function(scope, elm, attrs) { - elm.text(version); - }; -}]); + .directive('appVersion', ['version', version => { + return (scope, element, attributes) => { + element.text(version); + }; + }]); diff --git a/angular1/app/components/version/version-directive_test.ts b/angular1/app/components/version/version-directive_test.ts index 4a59e11..2510e13 100644 --- a/angular1/app/components/version/version-directive_test.ts +++ b/angular1/app/components/version/version-directive_test.ts @@ -1,15 +1,16 @@ 'use strict'; -describe('myApp.version module', function() { +describe('myApp.version module', () => { beforeEach(module('myApp.version')); - describe('app-version directive', function() { - it('should print current version', function() { - module(function($provide) { + describe('app-version directive', () => { + it('should print current version', () => { + module($provide => { $provide.value('version', 'TEST_VER'); }); - inject(function($compile, $rootScope) { - var element = $compile('')($rootScope); + + inject(($compile, $rootScope) => { + let element = $compile('')($rootScope); expect(element.text()).toEqual('TEST_VER'); }); }); diff --git a/angular1/app/components/version/version.ts b/angular1/app/components/version/version.ts index cb7a10f..0139bdb 100644 --- a/angular1/app/components/version/version.ts +++ b/angular1/app/components/version/version.ts @@ -4,5 +4,4 @@ angular.module('myApp.version', [ 'myApp.version.interpolate-filter', 'myApp.version.version-directive' ]) - .value('version', '0.1'); diff --git a/angular1/app/components/version/version_test.ts b/angular1/app/components/version/version_test.ts index 4ca6880..b911ef2 100644 --- a/angular1/app/components/version/version_test.ts +++ b/angular1/app/components/version/version_test.ts @@ -1,10 +1,10 @@ 'use strict'; -describe('myApp.version module', function() { +describe('myApp.version module', () => { beforeEach(module('myApp.version')); - describe('version service', function() { - it('should return current version', inject(function(version) { + describe('version service', () => { + it('should return current version', inject(version => { expect(version).toEqual('0.1'); })); }); diff --git a/angular1/app/view1/view1.ts b/angular1/app/view1/view1.ts index 4a50ba2..8cf391b 100644 --- a/angular1/app/view1/view1.ts +++ b/angular1/app/view1/view1.ts @@ -1,19 +1,14 @@ 'use strict'; -class View1Controller{ - static $inject = []; - constructor(){ - - } +class View1Controller { + static $inject = []; } angular.module('myApp.view1', ['ngRoute']) - -.config(['$routeProvider', function($routeProvider) { - $routeProvider.when('/view1', { - templateUrl: 'view1/view1.html', - controller: 'View1Ctrl' - }); -}]) - -.controller('View1Ctrl', View1Controller); + .config(['$routeProvider', $routeProvider => { + $routeProvider.when('/view1', { + templateUrl: 'view1/view1.html', + controller: 'View1Ctrl' + }); + }]) + .controller('View1Ctrl', View1Controller); diff --git a/angular1/app/view1/view1_test.ts b/angular1/app/view1/view1_test.ts index c993773..95fa007 100644 --- a/angular1/app/view1/view1_test.ts +++ b/angular1/app/view1/view1_test.ts @@ -1,16 +1,12 @@ 'use strict'; -describe('myApp.view1 module', function() { - +describe('myApp.view1 module', () => { beforeEach(module('myApp.view1')); - describe('view1 controller', function(){ - - it('should ....', inject(function($controller) { - //spec body - var view1Ctrl:View1Controller = $controller('View1Ctrl'); + describe('view1 controller', () => { + it('should be defined', inject($controller => { + let view1Ctrl: View1Controller = $controller('View1Ctrl'); expect(view1Ctrl).toBeDefined(); })); - }); }); diff --git a/angular1/app/view2/view2.ts b/angular1/app/view2/view2.ts index 35a8126..264db98 100644 --- a/angular1/app/view2/view2.ts +++ b/angular1/app/view2/view2.ts @@ -1,19 +1,14 @@ 'use strict'; -class View2Controller{ - static $inject = []; - constructor(){ - - } +class View2Controller { + static $inject = []; } angular.module('myApp.view2', ['ngRoute']) - -.config(['$routeProvider', function($routeProvider) { - $routeProvider.when('/view2', { - templateUrl: 'view2/view2.html', - controller: 'View2Ctrl' - }); -}]) - -.controller('View2Ctrl', View2Controller); + .config(['$routeProvider', $routeProvider => { + $routeProvider.when('/view2', { + templateUrl: 'view2/view2.html', + controller: 'View2Ctrl' + }); + }]) + .controller('View2Ctrl', View2Controller); diff --git a/angular1/app/view2/view2_test.ts b/angular1/app/view2/view2_test.ts index 8467624..b3ee22b 100644 --- a/angular1/app/view2/view2_test.ts +++ b/angular1/app/view2/view2_test.ts @@ -1,16 +1,12 @@ 'use strict'; -describe('myApp.view2 module', function() { - +describe('myApp.view2 module', () => { beforeEach(module('myApp.view2')); - describe('view2 controller', function(){ - - it('should ....', inject(function($controller) { - //spec body - var view2Ctrl:View2Controller = $controller('View2Ctrl'); + describe('view2 controller', () => { + it('should be defined', inject($controller => { + let view2Ctrl: View2Controller = $controller('View2Ctrl'); expect(view2Ctrl).toBeDefined(); })); - }); }); diff --git a/angular1/e2e-tests/scenarios.ts b/angular1/e2e-tests/scenarios.ts index 0e8348a..234906c 100644 --- a/angular1/e2e-tests/scenarios.ts +++ b/angular1/e2e-tests/scenarios.ts @@ -2,41 +2,29 @@ /* https://github.com/angular/protractor/blob/master/docs/toc.md */ -describe('my app', function() { - - - it('should automatically redirect to /view1 when location hash/fragment is empty', function() { +describe('my app', () => { + it('should automatically redirect to /view1 when location hash/fragment is empty', () => { browser.get('index.html'); expect(browser.getLocationAbsUrl()).toMatch("/view1"); }); - - describe('view1', function() { - - beforeEach(function() { + describe('view1', () => { + beforeEach(() => { browser.get('index.html#/view1'); }); - - it('should render view1 when user navigates to /view1', function() { - expect(element.all(by.css('[ng-view] p')).first().getText()). - toMatch(/partial for view 1/); + it('should render view1 when user navigates to /view1', () => { + expect(element.all(by.css('[ng-view] p')).first().getText()).toMatch(/partial for view 1/); }); - }); - - describe('view2', function() { - - beforeEach(function() { + describe('view2', () => { + beforeEach(() => { browser.get('index.html#/view2'); }); - - it('should render view2 when user navigates to /view2', function() { - expect(element.all(by.css('[ng-view] p')).first().getText()). - toMatch(/partial for view 2/); + it('should render view2 when user navigates to /view2', () => { + expect(element.all(by.css('[ng-view] p')).first().getText()).toMatch(/partial for view 2/); }); - }); });