diff --git a/README.md b/README.md index 119fb8eb8..cbab9ddfd 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +# TypeScript-Handbook Repo Deprecated + +The handbook has moved into the new TypeScript website repo, you can find the revised and updated handbook pages in [`/packages/documentation`](https://github.com/microsoft/TypeScript-Website/tree/v2/packages/documentation) in that repo. + +--- + # TypeScript-Handbook [![Build Status](https://travis-ci.org/Microsoft/TypeScript-Handbook.svg)](https://travis-ci.org/Microsoft/TypeScript-Handbook) diff --git a/assets/images/tutorials/aspnet/choosedependencies.png b/assets/images/tutorials/aspnet/choosedependencies.png new file mode 100644 index 000000000..1eb564311 Binary files /dev/null and b/assets/images/tutorials/aspnet/choosedependencies.png differ diff --git a/assets/images/tutorials/aspnet/createwebapp.png b/assets/images/tutorials/aspnet/createwebapp.png new file mode 100644 index 000000000..f48cfa7ad Binary files /dev/null and b/assets/images/tutorials/aspnet/createwebapp.png differ diff --git a/assets/images/tutorials/aspnet/debugger.png b/assets/images/tutorials/aspnet/debugger.png new file mode 100644 index 000000000..3b04bae92 Binary files /dev/null and b/assets/images/tutorials/aspnet/debugger.png differ diff --git a/assets/images/tutorials/aspnet/downloaddependency.png b/assets/images/tutorials/aspnet/downloaddependency.png new file mode 100644 index 000000000..fbca850aa Binary files /dev/null and b/assets/images/tutorials/aspnet/downloaddependency.png differ diff --git a/assets/images/tutorials/aspnet/emptytemplate.png b/assets/images/tutorials/aspnet/emptytemplate.png new file mode 100644 index 000000000..f35c04f63 Binary files /dev/null and b/assets/images/tutorials/aspnet/emptytemplate.png differ diff --git a/assets/images/tutorials/aspnet/install-nuget-packages.png b/assets/images/tutorials/aspnet/install-nuget-packages.png deleted file mode 100644 index 47afd45f2..000000000 Binary files a/assets/images/tutorials/aspnet/install-nuget-packages.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/namewebapp.png b/assets/images/tutorials/aspnet/namewebapp.png new file mode 100644 index 000000000..d32d1a5c1 Binary files /dev/null and b/assets/images/tutorials/aspnet/namewebapp.png differ diff --git a/assets/images/tutorials/aspnet/new-asp-project-empty-17.PNG b/assets/images/tutorials/aspnet/new-asp-project-empty-17.PNG deleted file mode 100644 index 74bb083e5..000000000 Binary files a/assets/images/tutorials/aspnet/new-asp-project-empty-17.PNG and /dev/null differ diff --git a/assets/images/tutorials/aspnet/new-asp-project-empty.png b/assets/images/tutorials/aspnet/new-asp-project-empty.png deleted file mode 100644 index 70f5b44db..000000000 Binary files a/assets/images/tutorials/aspnet/new-asp-project-empty.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/new-asp-project.png b/assets/images/tutorials/aspnet/new-asp-project.png deleted file mode 100644 index 3a5381775..000000000 Binary files a/assets/images/tutorials/aspnet/new-asp-project.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/new-folder.png b/assets/images/tutorials/aspnet/new-folder.png deleted file mode 100644 index 0c307e695..000000000 Binary files a/assets/images/tutorials/aspnet/new-folder.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/new-item.png b/assets/images/tutorials/aspnet/new-item.png deleted file mode 100644 index 880a4ceb9..000000000 Binary files a/assets/images/tutorials/aspnet/new-item.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/new-tsconfig.png b/assets/images/tutorials/aspnet/new-tsconfig.png deleted file mode 100644 index 7b4117524..000000000 Binary files a/assets/images/tutorials/aspnet/new-tsconfig.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/newfolder.png b/assets/images/tutorials/aspnet/newfolder.png new file mode 100644 index 000000000..9b09ce840 Binary files /dev/null and b/assets/images/tutorials/aspnet/newfolder.png differ diff --git a/assets/images/tutorials/aspnet/npm.png b/assets/images/tutorials/aspnet/npm.png new file mode 100644 index 000000000..082bff04d Binary files /dev/null and b/assets/images/tutorials/aspnet/npm.png differ diff --git a/assets/images/tutorials/aspnet/open-index.png b/assets/images/tutorials/aspnet/open-index.png deleted file mode 100644 index f3ff7e02e..000000000 Binary files a/assets/images/tutorials/aspnet/open-index.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/packageinstaller-angular2.png b/assets/images/tutorials/aspnet/packageinstaller-angular2.png deleted file mode 100644 index 194a665a0..000000000 Binary files a/assets/images/tutorials/aspnet/packageinstaller-angular2.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/packageinstaller-es6-shim.png b/assets/images/tutorials/aspnet/packageinstaller-es6-shim.png deleted file mode 100644 index 1729bd012..000000000 Binary files a/assets/images/tutorials/aspnet/packageinstaller-es6-shim.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/packageinstaller-systemjs.png b/assets/images/tutorials/aspnet/packageinstaller-systemjs.png deleted file mode 100644 index 2d5b85cc3..000000000 Binary files a/assets/images/tutorials/aspnet/packageinstaller-systemjs.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/packageinstaller-typings.png b/assets/images/tutorials/aspnet/packageinstaller-typings.png deleted file mode 100644 index 5c1e1e04e..000000000 Binary files a/assets/images/tutorials/aspnet/packageinstaller-typings.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/packagejson.png b/assets/images/tutorials/aspnet/packagejson.png new file mode 100644 index 000000000..4f0e985c6 Binary files /dev/null and b/assets/images/tutorials/aspnet/packagejson.png differ diff --git a/assets/images/tutorials/aspnet/paused-demo.png b/assets/images/tutorials/aspnet/paused-demo.png deleted file mode 100644 index e5e5cbbc1..000000000 Binary files a/assets/images/tutorials/aspnet/paused-demo.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/running-demo.png b/assets/images/tutorials/aspnet/running-demo.png deleted file mode 100644 index 70eee0cf7..000000000 Binary files a/assets/images/tutorials/aspnet/running-demo.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/scripts-folder.png b/assets/images/tutorials/aspnet/scripts-folder.png deleted file mode 100644 index 934e25b42..000000000 Binary files a/assets/images/tutorials/aspnet/scripts-folder.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/scripts.png b/assets/images/tutorials/aspnet/scripts.png new file mode 100644 index 000000000..84158170d Binary files /dev/null and b/assets/images/tutorials/aspnet/scripts.png differ diff --git a/assets/images/tutorials/aspnet/src-folder.png b/assets/images/tutorials/aspnet/src-folder.png deleted file mode 100644 index e25af24c4..000000000 Binary files a/assets/images/tutorials/aspnet/src-folder.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/task-runner-explorer.png b/assets/images/tutorials/aspnet/task-runner-explorer.png deleted file mode 100644 index 417f52620..000000000 Binary files a/assets/images/tutorials/aspnet/task-runner-explorer.png and /dev/null differ diff --git a/assets/images/tutorials/aspnet/taskrunner.png b/assets/images/tutorials/aspnet/taskrunner.png new file mode 100644 index 000000000..2ff7b6eaf Binary files /dev/null and b/assets/images/tutorials/aspnet/taskrunner.png differ diff --git a/assets/images/tutorials/aspnet/taskrunnerrefresh.png b/assets/images/tutorials/aspnet/taskrunnerrefresh.png new file mode 100644 index 000000000..727295d81 Binary files /dev/null and b/assets/images/tutorials/aspnet/taskrunnerrefresh.png differ diff --git a/assets/images/tutorials/aspnet/tsconfig.png b/assets/images/tutorials/aspnet/tsconfig.png new file mode 100644 index 000000000..fad4a0058 Binary files /dev/null and b/assets/images/tutorials/aspnet/tsconfig.png differ diff --git a/assets/images/tutorials/aspnet/tsfile.png b/assets/images/tutorials/aspnet/tsfile.png new file mode 100644 index 000000000..ee79517ba Binary files /dev/null and b/assets/images/tutorials/aspnet/tsfile.png differ diff --git a/assets/images/tutorials/aspnet/tsgif.mov b/assets/images/tutorials/aspnet/tsgif.mov new file mode 100644 index 000000000..dbb0c437e Binary files /dev/null and b/assets/images/tutorials/aspnet/tsgif.mov differ diff --git a/assets/images/tutorials/aspnet/workingsite.png b/assets/images/tutorials/aspnet/workingsite.png new file mode 100644 index 000000000..7974c1953 Binary files /dev/null and b/assets/images/tutorials/aspnet/workingsite.png differ diff --git a/attribution.json b/attribution.json new file mode 100644 index 000000000..23dd161fe --- /dev/null +++ b/attribution.json @@ -0,0 +1 @@ +{"pages/Advanced Types.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":65},{"name":"Nathan Shively-Sanders","gravatar":"f2d3b194d100bd25842ca048ab101408","count":33},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":9},{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":6},{"name":"fyodore82","gravatar":"f087ae54318360ef46aa4915eee5bc1b","count":4}],"total":41},"pages/Basic Types.md":{"top":[{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":53},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":25},{"name":"Orta Therox","gravatar":"28e997da43c10d99aa99273b48efe8cf","count":4},{"name":"Nathan Shively-Sanders","gravatar":"f2d3b194d100bd25842ca048ab101408","count":4},{"name":"Martin Veith","gravatar":"c14e40955314d925ddde906ee48fc437","count":3}],"total":32},"pages/Classes.md":{"top":[{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":53},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":27},{"name":"Nathan Shively-Sanders","gravatar":"f2d3b194d100bd25842ca048ab101408","count":8},{"name":"Brice Wilson","gravatar":"e1dfaa389348fc04d0807cc3d6252491","count":5},{"name":"AbubakerB","gravatar":"0ee4dca5013b6cc64b743efd60427648","count":3}],"total":20},"pages/Compiler Options in MSBuild.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":62},{"name":"Yui","gravatar":"c43ddeea6c2575b4f28e8e8107222501","count":4},{"name":"Daniel Rosenwasser","gravatar":"96588baac26f6b833dfd1ed0cd084287","count":4},{"name":"Nathan Shively-Sanders","gravatar":"8c5596e6ef2b41132cee585c9b146116","count":1},{"name":"Nico Sommi","gravatar":"09e3a35ab8733bf18c44b7bfe4095a9d","count":1}],"total":9},"pages/Compiler Options.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":96},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":19},{"name":"Axel D","gravatar":"bdf735cd1dd693d2608a997927cb7e7d","count":14},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":7},{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":7}],"total":43},"pages/Configuring Watch.md":{"top":[{"name":"Sheetal Nandi","gravatar":"eaddbe18695ecd437e1fb16b9eca1922","count":52},{"name":"0xflotus","gravatar":"f9d24e528b0f500d275ca815ec471097","count":1},{"name":"Philip Kirkbride","gravatar":"e2581b53db32340d7e1b5be6b99c2bb1","count":1}],"total":3},"pages/Declaration Merging.md":{"top":[{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":53},{"name":"Daniel Rosenwasser","gravatar":"8499bf678149d617cc71a23afb377736","count":20},{"name":"Nathan Shively-Sanders","gravatar":"f2d3b194d100bd25842ca048ab101408","count":10},{"name":"Orta Therox","gravatar":"28e997da43c10d99aa99273b48efe8cf","count":1},{"name":"Oliver THEBAULT","gravatar":"2d68f6160c2d4eef854c155532213102","count":1}],"total":13},"pages/Decorators.md":{"top":[{"name":"Ron Buckton","gravatar":"745f702d55c379fb824f5a03e0651e78","count":54},{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":3},{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":1},{"name":"John Spurlock","gravatar":"9196b648a4f24597e0423bda1db0e50b","count":1},{"name":"Keeley Hammond","gravatar":"dc7a3bb00dc978dd734f86b3c0636335","count":1}],"total":13},"pages/Enums.md":{"top":[{"name":"Vladimir Matveev","gravatar":"5aee15af22b78f239d28323e4194ca43","count":53},{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":5},{"name":"Orta Therox","gravatar":"28e997da43c10d99aa99273b48efe8cf","count":3},{"name":"Steven","gravatar":"e281254dfd07bc4571d2cc8910812494","count":3},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":2}],"total":15},"pages/Functions.md":{"top":[{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":55},{"name":"Daniel Rosenwasser","gravatar":"8499bf678149d617cc71a23afb377736","count":23},{"name":"Nathan Shively-Sanders","gravatar":"f2d3b194d100bd25842ca048ab101408","count":4},{"name":"Evan Carroll","gravatar":"605442f85418d858e2ce1e1aea2092bb","count":1},{"name":"Nathan Brown","gravatar":"4a7bdcca720edf514af0aa48e9be5983","count":1}],"total":19},"pages/Generics.md":{"top":[{"name":"Ryan Cavanaugh","gravatar":"b9d274ea3df40f132936da582f71b18f","count":51},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":19},{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":5},{"name":"Rick Carlino","gravatar":"f8b1ebd488deae76d970e7944fbae8e5","count":4},{"name":"Omar Boukli-Hacene","gravatar":"f0a423bd49afd126e1ae2f3b5d271ba7","count":1}],"total":12},"pages/Integrating with Build Tools.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":53},{"name":"Maurice de Beijer","gravatar":"974aa89116fa46b6895f67236546f417","count":6},{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":3},{"name":"Daniel Rosenwasser","gravatar":"8499bf678149d617cc71a23afb377736","count":3},{"name":"Dan Marshall","gravatar":"f4b952649f8547c67b43d41985b90892","count":2}],"total":10},"pages/Interfaces.md":{"top":[{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":55},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":25},{"name":"Orta Therox","gravatar":"28e997da43c10d99aa99273b48efe8cf","count":4},{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":3},{"name":"Nathan Shively-Sanders","gravatar":"f2d3b194d100bd25842ca048ab101408","count":3}],"total":35},"pages/Iterators and Generators.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":57},{"name":"Gabriel Burdeti","gravatar":"28ff7ada33ca80bfae575ae1321176ca","count":3},{"name":"Orta Therox","gravatar":"28e997da43c10d99aa99273b48efe8cf","count":1},{"name":"Kevin Sanders","gravatar":"21bb691b777fca0080f345a41c6c38c4","count":1},{"name":"Misaka","gravatar":"93d34858ab51a2ac9614e3777fb3766e","count":1}],"total":6},"pages/JSDoc Supported Types.md":{"top":[{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":52}],"total":1},"pages/JSX.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":55},{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":6},{"name":"David Zulaica","gravatar":"da0a821c09edbd8369777d622b446cc2","count":3},{"name":"Kanchalai Tanglertsampan","gravatar":"c8404f96910ba93ddc3e881b4bff24a4","count":3},{"name":"Jun Wan Goh","gravatar":"66910086db379e07e6bf44eea7af3e4c","count":2}],"total":24},"pages/Mixins.md":{"top":[{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":52},{"name":"Daniel Rosenwasser","gravatar":"8499bf678149d617cc71a23afb377736","count":7},{"name":"Vlad Balin","gravatar":"3fb10669d3d7ca93943af430039517e7","count":3},{"name":"Shingo Yamazaki","gravatar":"50fc0fdc2327ecbe7350645812de52e3","count":1},{"name":"rizalwildan","gravatar":"c8ad161319a0128539ba65ed898392cb","count":1}],"total":9},"pages/Module Resolution.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":70},{"name":"Andy Hanson","gravatar":"53f3bf1fab05451f834d0995fa07e47a","count":6},{"name":"Daniel Rosenwasser","gravatar":"8499bf678149d617cc71a23afb377736","count":6},{"name":"Dan Marshall","gravatar":"f4b952649f8547c67b43d41985b90892","count":3},{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":2}],"total":23},"pages/Modules.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":73},{"name":"Daniel Rosenwasser","gravatar":"8499bf678149d617cc71a23afb377736","count":22},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":6},{"name":"Andy Hanson","gravatar":"53f3bf1fab05451f834d0995fa07e47a","count":5},{"name":"Gabriel Burdeti","gravatar":"28ff7ada33ca80bfae575ae1321176ca","count":4}],"total":30},"pages/Namespaces and Modules.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"8499bf678149d617cc71a23afb377736","count":63},{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":19},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1},{"name":"William Shepherd","gravatar":"376fd9f7baa5237d630d53fbf40963c9","count":1},{"name":"Lukas Tetzlaff","gravatar":"dcaaa546f4d6e99652c39c1fc69442e4","count":1}],"total":11},"pages/Namespaces.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":56},{"name":"Daniel Rosenwasser","gravatar":"8499bf678149d617cc71a23afb377736","count":3},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1},{"name":"Shingo Yamazaki","gravatar":"50fc0fdc2327ecbe7350645812de52e3","count":1},{"name":"Julian Gong","gravatar":"fa260063391b9c0adda0d3451bc91799","count":1}],"total":12},"pages/Nightly Builds.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":52},{"name":"StefanRein","gravatar":"078daaad2c37d829a53e4db1827c0961","count":2},{"name":"macdja38","gravatar":"80a6ce7abf27e4f9eced990853689b4d","count":1}],"total":3},"pages/Project References.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":53},{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":3},{"name":"Orta Therox","gravatar":"28e997da43c10d99aa99273b48efe8cf","count":2},{"name":"Jake Ginnivan","gravatar":"49bd7a628b1d66a3e70c6550cecc92a3","count":1},{"name":"reduckted","gravatar":"8c2e5181520e296f3c832ecd11485169","count":1}],"total":11},"pages/Symbols.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":52},{"name":"Gabriel Burdeti","gravatar":"28ff7ada33ca80bfae575ae1321176ca","count":2},{"name":"f","gravatar":"c329e72c364be1b3279f538bce4b025f","count":1},{"name":"user135711","gravatar":"b2861419ffde55d6b31a7da6980e0b9a","count":1},{"name":"Daniel Rosenwasser","gravatar":"8499bf678149d617cc71a23afb377736","count":1}],"total":5},"pages/Triple-Slash Directives.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":58},{"name":"Orta Therox","gravatar":"28e997da43c10d99aa99273b48efe8cf","count":1},{"name":"Kevin Sanders","gravatar":"21bb691b777fca0080f345a41c6c38c4","count":1},{"name":"Marc Kassay","gravatar":"365e118c75387fcbb180c5f41c4e1314","count":1},{"name":"dennispg","gravatar":"36f7c310063cc77cbd099763f3347885","count":1}],"total":6},"pages/Type Checking JavaScript Files.md":{"top":[{"name":"Harry Nguyen","gravatar":"386e27141a29f5c1076619afc140ffb4","count":51},{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":3},{"name":"Nathan Shively-Sanders","gravatar":"8c5596e6ef2b41132cee585c9b146116","count":2},{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":2},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1}],"total":13},"pages/Type Compatibility.md":{"top":[{"name":"Ryan Cavanaugh","gravatar":"b9d274ea3df40f132936da582f71b18f","count":51},{"name":"Daniel Rosenwasser","gravatar":"8499bf678149d617cc71a23afb377736","count":19},{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":4},{"name":"Omar Boukli-Hacene","gravatar":"f0a423bd49afd126e1ae2f3b5d271ba7","count":3},{"name":"Lifu Huang","gravatar":"7a059c64ee0fef1c596016f137b29fb7","count":2}],"total":14},"pages/Type Inference.md":{"top":[{"name":"Ryan Cavanaugh","gravatar":"b9d274ea3df40f132936da582f71b18f","count":51},{"name":"Daniel Rosenwasser","gravatar":"8499bf678149d617cc71a23afb377736","count":10},{"name":"Martin Hanzel","gravatar":"306526665628a202cb974484101d3bcf","count":2},{"name":"John Jago","gravatar":"302329c4365a60e401442b1001adaf39","count":1},{"name":"Daniel Karp","gravatar":"4de779c6c2aa36c83ab9277b8be6ade2","count":1}],"total":7},"pages/Typings for NPM Packages.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":55},{"name":"Daniel Rosenwasser","gravatar":"8499bf678149d617cc71a23afb377736","count":3},{"name":"Wesley Wigham","gravatar":"b07f8059b2727c6b084bd0dc921118b9","count":1}],"total":3},"pages/Utility Types.md":{"top":[{"name":"christian","gravatar":"1f58f226873fbbebcb8d4741b56fc99c","count":54},{"name":"Ravshan Samandarov","gravatar":"a988ffa9b684e82b27d452373e5b6196","count":1},{"name":"David Sommerich","gravatar":"8c053f60eb5c32330a514ddda351259a","count":1},{"name":"David","gravatar":"26995695b6337ebf150734249dd45ee8","count":1},{"name":"Gerrit Birkeland","gravatar":"0dce420a6e88cb3f4a8aafd874123cd2","count":1}],"total":8},"pages/Variable Declarations.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":58},{"name":"Nathan Shively-Sanders","gravatar":"f2d3b194d100bd25842ca048ab101408","count":9},{"name":"Vimal Raghubir","gravatar":"9bd70673d4a0c3ab8461871af1896215","count":3},{"name":"Brett Cannon","gravatar":"962cb4064811fd8c78dfc01eb27d4871","count":3},{"name":"Orta Therox","gravatar":"28e997da43c10d99aa99273b48efe8cf","count":2}],"total":19},"pages/Writing Declaration Files.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":54},{"name":"0xflotus","gravatar":"f9d24e528b0f500d275ca815ec471097","count":1},{"name":"Andy Hanson","gravatar":"53f3bf1fab05451f834d0995fa07e47a","count":1},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":1},{"name":"wanderer06","gravatar":"1dce2f9e605ce3114edeaa2670065d0a","count":1}],"total":6},"pages/declaration files/By Example.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":57},{"name":"ydz-one","gravatar":"a1cf7e5d7e4c2f73a2789d9d1d3fe001","count":1},{"name":"Pylyp Borysov","gravatar":"a89473e7a895bc87515a5b3e9fbe207d","count":1},{"name":"Rafał Krupiński","gravatar":"20c66d3b08e6e3d858973b2a1c66d9a8","count":1},{"name":"Krzysztof Piasecki","gravatar":"42ee56a548ee6259f9e44a66d1c3aa61","count":1}],"total":6},"pages/declaration files/Consumption.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":52},{"name":"noymer","gravatar":"5b83a7075a76f5eef367c73d8b268a79","count":1},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":1}],"total":3},"pages/declaration files/Deep Dive.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":54}],"total":1},"pages/declaration files/Do's and Don'ts.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":55},{"name":"Orta Therox","gravatar":"28e997da43c10d99aa99273b48efe8cf","count":1},{"name":"Veniamin Krol","gravatar":"e05a27c24badea56b8a2110ed0028c58","count":1},{"name":"Sean","gravatar":"9a3132e47b67a9bbe01a23dcdaf7b1a1","count":1},{"name":"jaceclowdus","gravatar":"f11cc04b135c54e90ed4cb9b94d8def1","count":1}],"total":9},"pages/declaration files/Introduction.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":61},{"name":"Crhistian Ramirez","gravatar":"8e1b864790dd753f3474527c64201618","count":1},{"name":"Valera Rozuvan","gravatar":"937a84db1c29347e9c165db225c1ed79","count":1},{"name":"Jeremy Foster","gravatar":"c2726bd2cd11f19f5a75fb4f8aae8524","count":1},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":1}],"total":5},"pages/declaration files/Library Structures.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":57},{"name":"Daniel Rose","gravatar":"a818e7f65a790fe4ba3da95110749a30","count":3},{"name":"Kenrick","gravatar":"ae94bfe2904e0c4ecf8fab1f05092ed1","count":1},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":1}],"total":4},"pages/declaration files/Publishing.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":55},{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":2},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":2},{"name":"Wolfgang Ederer","gravatar":"b50d03f76efe75003adb63c5c7649842","count":1},{"name":"Wesley Wigham","gravatar":"b07f8059b2727c6b084bd0dc921118b9","count":1}],"total":9},"pages/declaration files/Templates.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":53}],"total":1},"pages/declaration files/templates/global-modifying-module.d.ts.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":53}],"total":1},"pages/declaration files/templates/global-plugin.d.ts.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":53},{"name":"Johnny","gravatar":"d33dd700ab180cf167ec9b6a5c510510","count":1}],"total":2},"pages/declaration files/templates/global.d.ts.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":53}],"total":1},"pages/declaration files/templates/module-class.d.ts.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":53},{"name":"Daniel Rose","gravatar":"a818e7f65a790fe4ba3da95110749a30","count":1}],"total":2},"pages/declaration files/templates/module-function.d.ts.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":53},{"name":"Daniel Rose","gravatar":"a818e7f65a790fe4ba3da95110749a30","count":1}],"total":2},"pages/declaration files/templates/module-plugin.d.ts.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":53}],"total":1},"pages/declaration files/templates/module.d.ts.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":53}],"total":1},"pages/release notes/Overview.md":{"top":[{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":54},{"name":"Jake","gravatar":"31e55836947e29445f1d7bc9588268c7","count":1}],"total":2},"pages/release notes/TypeScript 1.1.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":52},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1}],"total":2},"pages/release notes/TypeScript 1.3.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":52},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1}],"total":2},"pages/release notes/TypeScript 1.4.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":52},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1}],"total":2},"pages/release notes/TypeScript 1.5.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":52},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1},{"name":"Shawn Choi","gravatar":"6d91293b9dbb67211758818877635560","count":1},{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":1},{"name":"ferhat elmas","gravatar":"3e970e0e5d130ae179f5cfa9b3079b76","count":1}],"total":6},"pages/release notes/TypeScript 1.6.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":52},{"name":"neverRare","gravatar":"76f1fcc4b1158d1f3fe24b286d3c2867","count":1},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1}],"total":3},"pages/release notes/TypeScript 1.7.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":52},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1},{"name":"SlurpTheo","gravatar":"5acec65c2e9d1fb43f158bab22f79418","count":1}],"total":3},"pages/release notes/TypeScript 1.8.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":52},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1},{"name":"Achim Weimert","gravatar":"b8f0329cbb6cc9c7c6b08b2c48d5662f","count":1},{"name":"Volodymyr Pantasenko","gravatar":"63c9580b21ccec0970ee322fb9cd5360","count":1}],"total":4},"pages/release notes/TypeScript 2.0.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":52},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1},{"name":"Vallentin","gravatar":"cd86a6f79d7328127ae03645d14d0e64","count":1}],"total":3},"pages/release notes/TypeScript 2.1.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":58},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1},{"name":"Jaime","gravatar":"1dfad8107453e0f493ff1a6a8e48d503","count":1},{"name":"Steven","gravatar":"e281254dfd07bc4571d2cc8910812494","count":1},{"name":"Omar Gaayeb","gravatar":"03f75fa297ff893cfcfc8deb1e83d220","count":1}],"total":6},"pages/release notes/TypeScript 2.2.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":53},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1}],"total":2},"pages/release notes/TypeScript 2.3.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":51},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1},{"name":"Lars Reimann","gravatar":"d75b9305d0763a19dc0305a8c4f49546","count":1},{"name":"Oblosys","gravatar":"c08d37535f8b1f2d7c5785cfd21067b9","count":1},{"name":"Per Lundberg","gravatar":"e3b31c81a5f8c5dff8298a5e51f7dc29","count":1}],"total":5},"pages/release notes/TypeScript 2.4.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"96588baac26f6b833dfd1ed0cd084287","count":52},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1}],"total":2},"pages/release notes/TypeScript 2.5.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":51},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1}],"total":2},"pages/release notes/TypeScript 2.6.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":51},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1}],"total":2},"pages/release notes/TypeScript 2.7.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":52},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1},{"name":"Cameron Tacklind","gravatar":"719f14270bfe54a8a9cf6e831fde6aa2","count":1},{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":1},{"name":"ferhat elmas","gravatar":"3e970e0e5d130ae179f5cfa9b3079b76","count":1}],"total":7},"pages/release notes/TypeScript 2.8.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":55},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":1},{"name":"Wesley Wigham","gravatar":"b07f8059b2727c6b084bd0dc921118b9","count":1}],"total":4},"pages/release notes/TypeScript 2.9.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":51},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1}],"total":2},"pages/release notes/TypeScript 3.0.md":{"top":[{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":53},{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":2},{"name":"Ruslan Iusupov","gravatar":"e4eb89fda2c3d3f54efa810a9ba9b0da","count":2},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1},{"name":"Achim Weimert","gravatar":"b8f0329cbb6cc9c7c6b08b2c48d5662f","count":1}],"total":8},"pages/release notes/TypeScript 3.1.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"96588baac26f6b833dfd1ed0cd084287","count":51},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":3},{"name":"Sebastian Silbermann","gravatar":"8909c1e1d9b64fd5db83ca8e0d7e16a5","count":1},{"name":"Veniamin Krol","gravatar":"e05a27c24badea56b8a2110ed0028c58","count":1},{"name":"Achim Weimert","gravatar":"b8f0329cbb6cc9c7c6b08b2c48d5662f","count":1}],"total":8},"pages/release notes/TypeScript 3.2.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"96588baac26f6b833dfd1ed0cd084287","count":52},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1}],"total":2},"pages/release notes/TypeScript 3.3.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"96588baac26f6b833dfd1ed0cd084287","count":51},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1},{"name":"Riley Avron","gravatar":"ed9a8af14efbb5b912454280c1419fc3","count":1}],"total":3},"pages/release notes/TypeScript 3.4.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"96588baac26f6b833dfd1ed0cd084287","count":51},{"name":"ExE Boss","gravatar":"c6742bf17f729d9ec2f9e3cdddeb4bfa","count":1}],"total":2},"pages/release notes/TypeScript 3.5.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":51}],"total":1},"pages/release notes/TypeScript 3.6.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"96588baac26f6b833dfd1ed0cd084287","count":51},{"name":"Sergei Osipov","gravatar":"bff06c5f4b1be669e2c0241fd04a5c5b","count":1}],"total":2},"pages/release notes/TypeScript 3.7.md":{"top":[{"name":"Orta Therox","gravatar":"28e997da43c10d99aa99273b48efe8cf","count":55},{"name":"Jake","gravatar":"31e55836947e29445f1d7bc9588268c7","count":3},{"name":"Daniel Rosenwasser","gravatar":"96588baac26f6b833dfd1ed0cd084287","count":1},{"name":"Greg Murray","gravatar":"f01ffd250231ff6b0b79d0d400d58780","count":1},{"name":"Jamie B","gravatar":"3fd341dda3105fdfdb4590574c3e0d51","count":1}],"total":5},"pages/release notes/TypeScript 3.8.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"96588baac26f6b833dfd1ed0cd084287","count":51}],"total":1},"pages/release notes/index.html":{"top":[{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":51}],"total":1},"pages/tutorials/ASP.NET Core.md":{"top":[{"name":"Bowden Kelly","gravatar":"e87ecf3e2da8b667dd3a8005ac610d4a","count":56},{"name":"Gabrielle Crevecoeur","gravatar":"1d1c3d0dff776fedc6a4f10cd7824314","count":11},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":3},{"name":"Limin Zhu","gravatar":"6ff09ff871238f23c607356e5eee9dd1","count":2},{"name":"Vadim","gravatar":"ff86e0bf36b4276cf463309db564486f","count":1}],"total":8},"pages/tutorials/Angular.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"96588baac26f6b833dfd1ed0cd084287","count":52}],"total":1},"pages/tutorials/Gulp.md":{"top":[{"name":"Bowden Kelly","gravatar":"e87ecf3e2da8b667dd3a8005ac610d4a","count":51},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":3},{"name":"Ryan Cavanaugh","gravatar":"2484d99c8a58bc51ae587e07a05ba6e2","count":2},{"name":"Orta Therox","gravatar":"28e997da43c10d99aa99273b48efe8cf","count":1},{"name":"Brian","gravatar":"cd0bd0fb8907d12cdf894db4f25fa8ec","count":1}],"total":16},"pages/tutorials/Migrating from JavaScript.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":57},{"name":"Maayan Glikser","gravatar":"3a615b34ef2060face8fcd481c6377e1","count":3},{"name":"Sean","gravatar":"9a3132e47b67a9bbe01a23dcdaf7b1a1","count":1},{"name":"William Sun","gravatar":"2ad06c6816518e3738f323eda1aabb96","count":1},{"name":"Bowden Kelly","gravatar":"e87ecf3e2da8b667dd3a8005ac610d4a","count":1}],"total":10},"pages/tutorials/React & Webpack.md":{"top":[{"name":"Bowden Kelly","gravatar":"e87ecf3e2da8b667dd3a8005ac610d4a","count":52},{"name":"Daniel Rosenwasser","gravatar":"cd1cc3769958ccc22b86d6a87badfe31","count":13},{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":3},{"name":"Jason Jarrett","gravatar":"b92a22c70f03a3218b358cfeeb566ac4","count":3},{"name":"Matthias Bertram","gravatar":"a98073b1d569bc19e55a748ab0e8a61b","count":2}],"total":26},"pages/tutorials/React.md":{"top":[{"name":"Daniel Rosenwasser","gravatar":"96588baac26f6b833dfd1ed0cd084287","count":60},{"name":"Brooks Becton","gravatar":"adc0bb4710a7ca48ed5e30a5679af3b3","count":1},{"name":"Orta Therox","gravatar":"28e997da43c10d99aa99273b48efe8cf","count":1},{"name":"Achim Weimert","gravatar":"b8f0329cbb6cc9c7c6b08b2c48d5662f","count":1},{"name":"Sean","gravatar":"9a3132e47b67a9bbe01a23dcdaf7b1a1","count":1}],"total":10},"pages/tutorials/TypeScript in 5 minutes.md":{"top":[{"name":"Bowden Kelly","gravatar":"e87ecf3e2da8b667dd3a8005ac610d4a","count":53},{"name":"Lucas Garron","gravatar":"301e7905e37fa2fc88b1f42b38c026d9","count":1},{"name":"ferhat elmas","gravatar":"3e970e0e5d130ae179f5cfa9b3079b76","count":1},{"name":"prateekgoel","gravatar":"a1bf4353a470b765cadc852b1e718315","count":1},{"name":"Mohamed Hegazy","gravatar":"17e2da9785d45119a4c4cfed99e40d9c","count":1}],"total":6},"pages/tutorials/tsconfig.json.md":{"top":[{"name":"dumblole","gravatar":"4c1e32a3cf6acd5d71065cbce44b6607","count":51},{"name":"Jon Surrell","gravatar":"c925b2538b1f594a81f6ef2922c15e1d","count":2},{"name":"Orta Therox","gravatar":"f116cb3be23153ec08b94e8bd4dbcfeb","count":1},{"name":"Sean","gravatar":"9a3132e47b67a9bbe01a23dcdaf7b1a1","count":1}],"total":4}} \ No newline at end of file diff --git a/createAttributionJSON.js b/createAttributionJSON.js new file mode 100644 index 000000000..c652ba3c0 --- /dev/null +++ b/createAttributionJSON.js @@ -0,0 +1,100 @@ +const { execSync } = require("child_process"); +const path = require("path"); +const fs = require("fs"); +const crypto = require('crypto'); + +/** + Updates the JSON file `attribution.json` with contributors based on commits to files, to run: + + node createAttributionJSON.js +*/ +const handleDupeNames = (name) => { + if (name === "Orta") return "Orta Therox" + return name +} + +// Being first gets you a free x commits +const getOriginalAuthor = filepath => { + const creator = execSync(`git log --format='%an | %aE' --diff-filter=A -- "${filepath}"`) + .toString() + .trim(); + return { + name: creator.split(" | ")[0], + email: creator.split(" | ")[1] + }; +}; + +// Gets the rest of the authors for a file +const getAuthorsForFile = filepath => { + const cmd = `git log --format='%an | %aE' -- "${filepath}"` + const contributors = execSync(cmd).toString().trim() + + const allContributions = contributors.split("\n").map(c => { + return { + name: handleDupeNames(c.split(" | ")[0]), + email: c.split(" | ")[1] + }; + }); + + // Keep a map of all found authors, + const objs = new Map() + allContributions.forEach(c => { + const id = c.name.toLowerCase().replace(/\s/g, "") + const existing = objs.get(id) + if (existing) { + objs.set(id, { name: c.name, gravatar: existing.gravatar, count: existing.count + 1 }) + } else { + const email = c.email || "NOOP" + objs.set(id, { name: c.name, gravatar: crypto.createHash('md5').update(email).digest('hex'), count: 1 }) + } + }) + + return [...objs.values()] +}; + +const allFiles = recursiveReadDirSync("pages") +// const allFiles = ["pages/JSDoc Supported Types.md"]; + +const json = {} + +allFiles.forEach(f => { + const first = getOriginalAuthor(f); + const rest = getAuthorsForFile(f) + + const firstInRest = rest.find(a => a.name === first.name) + firstInRest.count += 50 + + rest.sort((l, r) => r.count - l.count) + console.log(" - " + f + " (" + rest.length + ")") + json[f] = { top: rest.slice(0, 5), total: rest.length } +}); + +fs.writeFileSync("attribution.json", JSON.stringify(json)) + + + + +/** Recursively retrieve file paths from a given folder and its subfolders. */ +// https://gist.github.com/kethinov/6658166#gistcomment-2936675 +/** @returns {string[]} */ +function recursiveReadDirSync(folderPath) { + if (!fs.existsSync(folderPath)) return [] + + const entryPaths = fs + .readdirSync(folderPath) + .map(entry => path.join(folderPath, entry)) + + const filePaths = entryPaths.filter(entryPath => + fs.statSync(entryPath).isFile() + ) + const dirPaths = entryPaths.filter( + entryPath => !filePaths.includes(entryPath) + ) + const dirFiles = dirPaths.reduce( + (prev, curr) => prev.concat(recursiveReadDirSync(curr)), + [] + ) + + return [...filePaths, ...dirFiles] + .filter(f => !f.endsWith(".DS_Store") && !f.endsWith("README.md")) +} diff --git a/pages/Advanced Types.md b/pages/Advanced Types.md index b4504a72e..10c96566e 100644 --- a/pages/Advanced Types.md +++ b/pages/Advanced Types.md @@ -370,6 +370,8 @@ sn = undefined; // error, 'undefined' is not assignable to 'string | null' Note that TypeScript treats `null` and `undefined` differently in order to match JavaScript semantics. `string | null` is a different type than `string | undefined` and `string | undefined | null`. +From TypeScript 3.7 and onwards, you can use [optional chaining](/docs/handbook/release-notes/typescript-3-7.html#optional-chaining) to simplify working with nullable types. + ## Optional parameters and properties With `--strictNullChecks`, an optional parameter automatically adds `| undefined`: @@ -525,7 +527,7 @@ declare function aliased(arg: Alias): Alias; declare function interfaced(arg: Interface): Interface; ``` -in older versions of TypeScript, type aliases couldn't be extended or implemented from (nor could they extend/implement other types). As of version 2.7, type aliases can be extended by creating a new intersection type e.g. `type Cat = Animal & { purrs: true }`. +In older versions of TypeScript, type aliases couldn't be extended or implemented from (nor could they extend/implement other types). As of version 2.7, type aliases can be extended by creating a new intersection type e.g. `type Cat = Animal & { purrs: true }`. Because [an ideal property of software is being open to extension](https://en.wikipedia.org/wiki/Open/closed_principle), you should always use an interface over a type alias if possible. @@ -586,7 +588,7 @@ function rollDice(): 1 | 2 | 3 | 4 | 5 | 6 { } ``` -These are seldom written explicitly, they can be useful when narrowing can catch bugs: +These are seldom written explicitly, but they can be useful when narrowing issues and can catch bugs: ```ts function foo(x: number) { @@ -840,7 +842,7 @@ Once you return the `T[K]` result, the compiler will instantiate the actual type ```ts let name: string = getProperty(taxi, 'manufacturer'); -let age: number = getProperty(taxi, 'model'); +let year: number = getProperty(taxi, 'year'); // error, 'unknown' is not in 'manufacturer' | 'model' | 'year' let unknown = getProperty(taxi, 'unknown'); @@ -1051,7 +1053,7 @@ As an example of some types that are immediately resolved, we can take a look at ```ts declare function f(x: T): T extends true ? string : number; -// Type is 'string | number +// Type is 'string | number' let x = f(Math.random() < 0.5) ``` diff --git a/pages/Basic Types.md b/pages/Basic Types.md index 55d492878..9a05ba253 100644 --- a/pages/Basic Types.md +++ b/pages/Basic Types.md @@ -1,3 +1,19 @@ +# Table of Contents +1. [Introduction](#introduction) +2. [Boolean](#boolean) +3. [Number](#number) +4. [String](#string) +5. [Array](#array) +6. [Tuple](#tuple) +7. [Enum](#enum) +8. [Any](#any) +9. [Void](#void) +10. [Null and Undefined](#null-and-undefined) +11. [Never](#never) +12. [Object](#object) +13. [Type assertions](#type-assertions) +14. [A note about 'let'](#a-note-about-let) + # Introduction For programs to be useful, we need to be able to work with some of the simplest units of data: numbers, strings, structures, boolean values, and the like. @@ -159,6 +175,8 @@ let prettySure: Object = 4; prettySure.toFixed(); // Error: Property 'toFixed' doesn't exist on type 'Object'. ``` +> Note: Avoid using `Object` in favor of the non-primitive `object` type as described in our [Do's and Don'ts](https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html#general-types) section. + The `any` type is also handy if you know some part of the type, but perhaps not all of it. For example, you may have an array but the array has a mix of different types: @@ -239,7 +257,7 @@ function infiniteLoop(): never { # Object -`object` is a type that represents the non-primitive type, i.e. anything that is not `number`, `string`, `boolean`, `symbol`, `null`, or `undefined`. +`object` is a type that represents the non-primitive type, i.e. anything that is not `number`, `string`, `boolean`, `bigint`, `symbol`, `null`, or `undefined`. With `object` type, APIs like `Object.create` can be better represented. For example: @@ -288,5 +306,5 @@ Using one over the other is mostly a choice of preference; however, when using T # A note about `let` You may've noticed that so far, we've been using the `let` keyword instead of JavaScript's `var` keyword which you might be more familiar with. -The `let` keyword is actually a newer JavaScript construct that TypeScript makes available. +The `let` keyword was introduced to JavaScript in ES2015 and is now considered the standard because it's safer than `var`. We'll discuss the details later, but many common problems in JavaScript are alleviated by using `let`, so you should use it instead of `var` whenever possible. diff --git a/pages/Classes.md b/pages/Classes.md index 4b268ad65..dd9934dfe 100644 --- a/pages/Classes.md +++ b/pages/Classes.md @@ -136,9 +136,25 @@ class Animal { } ``` -## Understanding `private` +## ECMAScript Private Fields -When a member is marked `private`, it cannot be accessed from outside of its containing class. For example: +With TypeScript 3.8, TypeScript supports the new JavaScript syntax for private fields: + +```ts +class Animal { + #name: string; + constructor(theName: string) { this.#name = theName; } +} + +new Animal("Cat").#name; // Property '#name' is not accessible outside class 'Animal' because it has a private identifier. +``` + +This syntax is built into the JavaScript runtime and can have better guarantees about the isolation of each private field. +Right now, the best documentation for these private fields is in the TypeScript 3.8 [release notes](https://devblogs.microsoft.com/typescript/announcing-typescript-3-8-beta/#ecmascript-private-fields). + +## Understanding TypeScript's `private` + +TypeScript also has it's own way to declare a member as being marked `private`, it cannot be accessed from outside of its containing class. For example: ```ts class Animal { @@ -446,7 +462,7 @@ class Greeter { let greeter: Greeter; greeter = new Greeter("world"); -console.log(greeter.greet()); +console.log(greeter.greet()); // "Hello, world" ``` Here, when we say `let greeter: Greeter`, we're using `Greeter` as the type of instances of the class `Greeter`. @@ -469,7 +485,7 @@ let Greeter = (function () { let greeter; greeter = new Greeter("world"); -console.log(greeter.greet()); +console.log(greeter.greet()); // "Hello, world" ``` Here, `let Greeter` is going to be assigned the constructor function. @@ -495,13 +511,13 @@ class Greeter { let greeter1: Greeter; greeter1 = new Greeter(); -console.log(greeter1.greet()); +console.log(greeter1.greet()); // "Hello, there" let greeterMaker: typeof Greeter = Greeter; greeterMaker.standardGreeting = "Hey there!"; let greeter2: Greeter = new greeterMaker(); -console.log(greeter2.greet()); +console.log(greeter2.greet()); // "Hey there!" ``` In this example, `greeter1` works similarly to before. diff --git a/pages/Compiler Options in MSBuild.md b/pages/Compiler Options in MSBuild.md index bb9cc2b6b..618a6fe99 100644 --- a/pages/Compiler Options in MSBuild.md +++ b/pages/Compiler Options in MSBuild.md @@ -97,6 +97,7 @@ Compiler Option | MSBuild Property Name `--traceResolution` | *Not supported in MSBuild* | `--types` | *Not supported in MSBuild* | `--typeRoots` | *Not supported in MSBuild* | +`--useDefineForClassFields` | TypeScriptUseDefineForClassFields | boolean `--watch` | *Not supported in MSBuild* | *MSBuild only option* | TypeScriptAdditionalFlags | *Any compiler option* diff --git a/pages/Compiler Options.md b/pages/Compiler Options.md index af8463c1c..404348a21 100644 --- a/pages/Compiler Options.md +++ b/pages/Compiler Options.md @@ -1,5 +1,27 @@ +## Using the CLI + +Running `tsc` locally will compile the closest project defined by a `tsconfig.json`, you can compile a set of TypeScript +files by passing in a glob of files you want. + +```sh +# Run a compile based on a backwards look through the fs for a tsconfig.json +tsc + +# Transpile just the index.ts with the compiler defaults +tsc index.ts + +# Transpile any .ts files in the folder src, with the default settings +tsc src/*.ts + +# Transpile any .ts files in the folder src, with the compiler settings from tsconfig.json +tsc --project tsconfig.json src/*.ts +``` + ## Compiler Options +If you're looking for more information about the compiler options in a tsconfig, check out the TSConfig Reference beta +available in [the v2 site](https://www.staging-typescript.org/tsconfig). + Option | Type | Default | Description -----------------------------------------------|-----------|--------------------------------|---------------------------------------------------------------------- `--allowJs` | `boolean` | `false` | Allow JavaScript files to be compiled. @@ -8,6 +30,7 @@ Option | Type | Default `--allowUnreachableCode` | `boolean` | `false` | Do not report errors on unreachable code. `--allowUnusedLabels` | `boolean` | `false` | Do not report errors on unused labels. `--alwaysStrict` | `boolean` | `false` | Parse in strict mode and emit `"use strict"` for each source file +`--assumeChangesOnlyAffectDirectDependencies` | `boolean` | `false` | Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it `--baseUrl` | `string` | | Base directory to resolve non-relative module names. See [Module Resolution documentation](./Module%20Resolution.md#base-url) for more details. `--build`
`-b` | `boolean` | `false` | Builds this project and all of its dependencies specified by [Project References](./Project%20References.md). Note that this flag is not compatible with others on this page. See more [here](./Project%20References.md) `--charset` | `string` | `"utf8"` | The character set of the input files. @@ -26,16 +49,20 @@ Option | Type | Default `--experimentalDecorators`[1] | `boolean` | `false` | Enables experimental support for ES decorators. `--extendedDiagnostics` | `boolean` | `false` | Show verbose diagnostic information `--forceConsistentCasingInFileNames` | `boolean` | `false` | Disallow inconsistently-cased references to the same file. +`--generateCpuProfile` | `string` | `profile.cpuprofile` | Generates a cpu profile at the given path. Passing an existing directory name instead of a file path will cause a timestamp-named profile to be generated in that directory instead. `--help`
`-h` | | | Print help message. `--importHelpers` | `boolean` | `false` | Import emit helpers (e.g. `__extends`, `__rest`, etc..) from [`tslib`](https://www.npmjs.com/package/tslib) +`--importsNotUsedAsValues` | `string` | `remove` | Specify emit/checking behavior for imports that are only used for types. `"remove"` and `"preserve"` specify whether to emit unused imports for side effects, and `"error"` enforces that imports used only for types are written with `import type`. `--incremental` | `boolean` | `true` if `composite` is on, `false` otherwise | Enable incremental compilation by reading/writing information from prior compilations to a file on disk. This file is controlled by the `--tsBuildInfoFile` flag. `--inlineSourceMap` | `boolean` | `false` | Emit a single file with source maps instead of having a separate file. `--inlineSources` | `boolean` | `false` | Emit the source alongside the sourcemaps within a single file; requires `--inlineSourceMap` or `--sourceMap` to be set. `--init` | | | Initializes a TypeScript project and creates a `tsconfig.json` file. -`--isolatedModules` | `boolean` | `false` | Transpile each file as a separate module (similar to "ts.transpileModule"). +`--isolatedModules` | `boolean` | `false` | Perform additional checks to ensure that separate compilation (such as with [`transpileModule`](https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-simple-transform-function) or [@babel/plugin-transform-typescript](https://babeljs.io/docs/en/babel-plugin-transform-typescript)) would be safe. `--jsx` | `string` | `"preserve"` | Support JSX in `.tsx` files: `"react"`, `"preserve"`, `"react-native"`. See [JSX](./JSX.md). `--jsxFactory` | `string` | `"React.createElement"` | Specify the JSX factory function to use when targeting react JSX emit, e.g. `React.createElement` or `h`. -`--keyofStringsOnly` | `boolean` | `false` | Resolve `keyof` to string valued property names only (no numbers or symbols). +`--jsxFragmentFactory` | `string` | `"React.Fragment"` | Specify the JSX fragment reference to use when targeting react JSX emit, e.g. `React.Fragment` or `Fragment`. +`--keyofStringsOnly` | `boolean` | `false` | Resolve `keyof` to string valued property names only (no numbers or symbols). +`--useDefineForClassFields` | `boolean` | `false` | Emit class fields with ECMAScript-standard semantics. `--lib` | `string[]`| | List of library files to be included in the compilation.
Possible values are:
► `ES5`
► `ES6`
► `ES2015`
► `ES7`
► `ES2016`
► `ES2017`
► `ES2018`
► `ESNext`
► `DOM`
► `DOM.Iterable`
► `WebWorker`
► `ScriptHost`
► `ES2015.Core`
► `ES2015.Collection`
► `ES2015.Generator`
► `ES2015.Iterable`
► `ES2015.Promise`
► `ES2015.Proxy`
► `ES2015.Reflect`
► `ES2015.Symbol`
► `ES2015.Symbol.WellKnown`
► `ES2016.Array.Include`
► `ES2017.object`
► `ES2017.Intl`
► `ES2017.SharedMemory`
► `ES2017.String`
► `ES2017.TypedArrays`
► `ES2018.Intl`
► `ES2018.Promise`
► `ES2018.RegExp`
► `ESNext.AsyncIterable`
► `ESNext.Array`
► `ESNext.Intl`
► `ESNext.Symbol`

Note: If `--lib` is not specified a default list of libraries are injected. The default libraries injected are:
► For `--target ES5`: `DOM,ES5,ScriptHost`
► For `--target ES6`: `DOM,ES6,DOM.Iterable,ScriptHost` `--listEmittedFiles` | `boolean` | `false` | Print names of generated files part of the compilation. `--listFiles` | `boolean` | `false` | Print names of files part of the compilation. diff --git a/pages/Enums.md b/pages/Enums.md index dc14d6a0f..12b8d8c34 100644 --- a/pages/Enums.md +++ b/pages/Enums.md @@ -263,7 +263,7 @@ let a = Enum.A; let nameOfA = Enum[a]; // "A" ``` -TypeScript might compile this down to something like the the following JavaScript: +TypeScript might compile this down to something like the following JavaScript: ```js var Enum; diff --git a/pages/Interfaces.md b/pages/Interfaces.md index 74baab7f9..59fd8784f 100644 --- a/pages/Interfaces.md +++ b/pages/Interfaces.md @@ -255,7 +255,6 @@ mySearch = function(src: string, sub: string): boolean { Function parameters are checked one at a time, with the type in each corresponding parameter position checked against each other. If you do not want to specify types at all, TypeScript's contextual typing can infer the argument types since the function value is assigned directly to a variable of type `SearchFunc`. Here, also, the return type of our function expression is implied by the values it returns (here `false` and `true`). -Had the function expression returned numbers or strings, the type checker would have warned us that return type doesn't match the return type described in the `SearchFunc` interface. ```ts let mySearch: SearchFunc; @@ -265,6 +264,19 @@ mySearch = function(src, sub) { } ``` +Had the function expression returned numbers or strings, the type checker would have made an error that indicates return type doesn't match the return type described in the `SearchFunc` interface. + +```ts +let mySearch: SearchFunc; + +// error: Type '(src: string, sub: string) => string' is not assignable to type 'SearchFunc'. +// Type 'string' is not assignable to type 'boolean'. +mySearch = function(src, sub) { + let result = src.search(sub); + return "string"; +}; +``` + # Indexable Types Similarly to how we can use interfaces to describe function types, we can also describe types that we can "index into" like `a[10]`, or `ageMap["daniel"]`. @@ -324,6 +336,7 @@ interface NumberOrStringDictionary { [index: string]: number | string; length: number; // ok, length is a number name: string; // ok, name is a string +} ``` Finally, you can make index signatures `readonly` in order to prevent assignment to their indices: diff --git a/pages/JSDoc Supported Types.md b/pages/JSDoc Supported Types.md index d65332362..468698928 100644 --- a/pages/JSDoc Supported Types.md +++ b/pages/JSDoc Supported Types.md @@ -17,6 +17,8 @@ Note any tags which are not explicitly listed below (such as `@async`) are not y The meaning is usually the same, or a superset, of the meaning of the tag given at [jsdoc.app](https://jsdoc.app). The code below describes the differences and gives some example usage of each tag. +**Note:** You can use [the playground to explore JSDoc support](https://www.typescriptlang.org/play/index.html?useJavaScript=truee=4#example/jsdoc-support). + ## `@type` You can use the "@type" tag and reference a type name (either primitive, defined in a TypeScript declaration, or in a JSDoc "@typedef" tag). diff --git a/pages/JSX.md b/pages/JSX.md index 88b1a912c..1d12e0ead 100644 --- a/pages/JSX.md +++ b/pages/JSX.md @@ -218,7 +218,7 @@ function MyFactoryFunction() { // use a call signature var myComponent = MyFactoryFunction(); -// element class type => FactoryFunction +// element class type => MyFactoryFunction // element instance type => { render: () => void } ``` diff --git a/pages/Modules.md b/pages/Modules.md index 3026f670e..452a71b50 100644 --- a/pages/Modules.md +++ b/pages/Modules.md @@ -1,8 +1,3 @@ -> **A note about terminology:** -It's important to note that in TypeScript 1.5, the nomenclature has changed. -"Internal modules" are now "namespaces". -"External modules" are now simply "modules", as to align with [ECMAScript 2015](http://www.ecma-international.org/ecma-262/6.0/)'s terminology, (namely that `module X {` is equivalent to the now-preferred `namespace X {`). - # Introduction Starting with ECMAScript 2015, JavaScript has a concept of modules. TypeScript shares this concept. @@ -129,6 +124,22 @@ To import these modules, use: import "./my-module.js"; ``` +## Importing Types + +Prior to TypeScript 3.8, you can import a type using `import`. +With TypeScript 3.8, you can import a type using the `import` statement, or using `import type`. + +```ts +// Re-using the same import +import {APIResponseType} from "./api"; + +// Explicitly use import type +import type {APIResponseType} from "./api"; +``` + +`import type` is always guaranteed to be removed from your JavaScript, and tools like Babel can make better assumptions about your code via the `isolatedModules` compiler flag. +You can read more in the [3.8 release notes](https://devblogs.microsoft.com/typescript/announcing-typescript-3-8-beta/#type-only-imports-exports). + # Default exports Each module can optionally export a `default` export. @@ -216,6 +227,20 @@ import num from "./OneTwoThree"; console.log(num); // "123" ``` +## Export all as x + +With TypeScript 3.8, you can use `export * as ns` as a shorthand for re-exporting another module with a name: + +```ts +export * as utilities from "./utilities"; +``` + +This takes all of the dependencies from a module and makes it an exported field, you could import it like this: + +```ts +import { utilities } from "./index"; +``` + # `export =` and `import = require()` Both CommonJS and AMD generally have the concept of an `exports` object which contains all exports from a module. diff --git a/pages/Namespaces and Modules.md b/pages/Namespaces and Modules.md index 713367fcf..5a6667611 100644 --- a/pages/Namespaces and Modules.md +++ b/pages/Namespaces and Modules.md @@ -1,32 +1,18 @@ -> **A note about terminology:** -It's important to note that in TypeScript 1.5, the nomenclature has changed. -"Internal modules" are now "namespaces". -"External modules" are now simply "modules", as to align with [ECMAScript 2015](http://www.ecma-international.org/ecma-262/6.0/)'s terminology, (namely that `module X {` is equivalent to the now-preferred `namespace X {`). - # Introduction -This post outlines the various ways to organize your code using namespaces and modules in TypeScript. +This post outlines the various ways to organize your code using modules and namespaces in TypeScript. We'll also go over some advanced topics of how to use namespaces and modules, and address some common pitfalls when using them in TypeScript. -See the [Modules](./Modules.md) documentation for more information about modules. -See the [Namespaces](./Namespaces.md) documentation for more information about namespaces. - -# Using Namespaces - -Namespaces are simply named JavaScript objects in the global namespace. -This makes namespaces a very simple construct to use. -They can span multiple files, and can be concatenated using `--outFile`. -Namespaces can be a good way to structure your code in a Web Application, with all dependencies included as ` + + + + diff --git a/pages/tutorials/ASP.NET Core.md b/pages/tutorials/ASP.NET Core.md index e54769f9e..54808231e 100644 --- a/pages/tutorials/ASP.NET Core.md +++ b/pages/tutorials/ASP.NET Core.md @@ -1,68 +1,45 @@ -# Setup +# ASP.NET Core + TypeScript -## Install ASP.NET Core and TypeScript +## Setup +### Install ASP.NET Core and TypeScript +First, install [ASP.NET Core](https://dotnet.microsoft.com/apps/aspnet) if you need it. This quick-start guide requires Visual Studio 2015 or 2017. -First, [install ASP.NET Core](https://get.asp.net) if you need it. This quick-start guide requires Visual Studio 2015 or 2017. - -Next, if your version of Visual Studio does not already have the latest TypeScript, you can [install it](http://www.microsoft.com/en-us/download/details.aspx?id=48593). - -## Create a new project +Next, if your version of Visual Studio does not already have the latest TypeScript, you can [install it](https://www.typescriptlang.org/index.html#download-links). +### Create a new project 1. Choose **File** 2. Choose **New Project** (Ctrl + Shift + N) -3. Choose **Visual C#** -4. For VS2015, choose **ASP.NET Web Application** > **ASP.NET 5 Empty**, and let's uncheck "Host in the cloud" since we're going to run this locally. +3. Search for **.NET Core** in the project search bar +4. Select **ASP.NET Core Web Application** and press the *Next* button - ![Use empty template](../../assets/images/tutorials/aspnet/new-asp-project-empty.png) +![](../../assets/images/tutorials/aspnet/createwebapp.png) - For VS2017, choose **ASP.NET Core Web Application (.NET Core)** > **ASP.NET Core 1.1 Empty** instead. +5. Name your project and solution. After select the *Create* button - ![Use empty template VS2017](../../assets/images/tutorials/aspnet/new-asp-project-empty-17.PNG) +![](../../assets/images/tutorials/aspnet/namewebapp.png) -Run the application and make sure that it works. +6. In the last window, select the **Empty** template and press the *Create* button -## Set up the server +![](../../assets/images/tutorials/aspnet/emptytemplate.png) -### VS2015 +Run the application and make sure that it works. -In `project.json` add another entry in `"dependencies"`: +![](../../assets/images/tutorials/aspnet/workingsite.png) -```json -"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final" -``` +### Set up the server +Open **Dependencies > Manage NuGet Packages > Browse.** Search and install `Microsoft.AspNetCore.StaticFiles` and `Microsoft.TypeScript.MSBuild`: -The resulting dependencies should look like this: +![](../../assets/images/tutorials/aspnet/downloaddependency.png) -```json - "dependencies": { - "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final", - "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", - "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final" - }, -``` - -Replace the body of `Configure` in `Startup.cs` with - -```cs -public void Configure(IApplicationBuilder app) +Open up your `Startup.cs` file and edit your `Configure` function to look like this: +``` +public void Configure(IApplicationBuilder app, IHostingEnvironment env) { - app.UseIISPlatformHandler(); - app.UseDefaultFiles(); - app.UseStaticFiles(); -} -``` - -### VS2017 - -Open **Dependencies** > **Manage NuGet Packages** > **Browse**. Search and install `Microsoft.AspNetCore.StaticFiles` 1.1.2: - -![Install Microsoft.AspNetCore.StaticFiles](../../assets/images/tutorials/aspnet/install-nuget-packages.png) - -Replace the body of `Configure` in `Startup.cs` with + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } -```cs -public void Configure(IApplicationBuilder app) -{ app.UseDefaultFiles(); app.UseStaticFiles(); } @@ -70,26 +47,22 @@ public void Configure(IApplicationBuilder app) You may need to restart VS for the red squiggly lines below `UseDefaultFiles` and `UseStaticFiles` to disappear. -# Add TypeScript - -The next step is to add a folder for TypeScript. +## Add TypeScript +Next we will add a new folder and call it `scripts`. -![Create new folder](../../assets/images/tutorials/aspnet/new-folder.png) +![](../../assets/images/tutorials/aspnet/newfolder.png) -We'll just call it `scripts`. +![](../../assets/images/tutorials/aspnet/scripts.png) -![scripts folder](../../assets/images/tutorials/aspnet/scripts-folder.png) +### Add TypeScript code -## Add TypeScript code +Right click on `scripts` and click **New Item**. Then choose **TypeScript File** and name the file `app.ts` -Right click on `scripts` and click **New Item**. -Then choose **TypeScript File** (it may be in the .NET Core section) and name the file `app.ts`. +![](../../assets/images/tutorials/aspnet/tsfile.png) -![New item](../../assets/images/tutorials/aspnet/new-item.png) +### Add example code -## Add example code - -Type the following code into app.ts. +Add the following code to the `app.ts` file. ```ts function sayHello() { @@ -98,64 +71,62 @@ function sayHello() { return `Hello from ${compiler} and ${framework}!`; } ``` +### Set up the build -## Set up the build - -### Configure the TypeScript compiler - -First we need to tell TypeScript how to build. -Right click on the scripts folder and click **New Item**. -Then choose **TypeScript Configuration File** and use the default name `tsconfig.json`. +*Configure the TypeScript compiler* -![Create tsconfig.json](../../assets/images/tutorials/aspnet/new-tsconfig.png) +First we need to tell TypeScript how to build. Right click on `scripts` and click **New Item**. Then choose **TypeScript Configuration File** and use the default name of `tsconfig.json` -Replace the default `tsconfig.json` with the following: +![](../../assets/images/tutorials/aspnet/tsconfig.png) -```json +Replace the contents of the `tsconfig.json` file with: +``` { "compilerOptions": { - "noImplicitAny": true, - "noEmitOnError": true, - "sourceMap": true, - "target": "es5" + "noEmitOnError": true, + "noImplicitAny": true, + "sourceMap": true, + "target": "es6" }, "files": [ - "./app.ts" + "./app.ts" ], "compileOnSave": true } ``` +* `onEmitOnError` : Do not emit outputs if any errors were reported. +* `noImplicitAny` : Raise error on expressions and declarations with an implied `any` type. +* `sourceMap` : Generates corresponding `.map` file. +* `target` : Specify ECMAScript target version. + +Note: `"ESNext"` targets latest supported -This is similar to the default, with the following differences: +`"noImplicitAny"` is good idea whenever you’re writing new code — you can make sure that you don’t write any untyped code by mistake. `"compileOnSave"` makes it easy to update your code in a running web app. -1. It sets `"noImplicitAny": true`. -2. It explicitly lists `"files"` instead of relying on `"excludes"`. -3. It sets `"compileOnSave": true`. +*Set up NPM* # -`"noImplicitAny"` is good idea whenever you're writing new code — you can make sure that you don't write any untyped code by mistake. -`"compileOnSave"` makes it easy to update your code in a running web app. +We need to setup NPM so that JavaScript packages can be downloaded. Right click on the project and select **New Item**. Then choose **NPM Configuration File** and use the default name of `package.json`. -### Set up NPM +![](../../assets/images/tutorials/aspnet/packagejson.png) -Now we need to set up NPM so we can download JavaScript packages. -Right click on the project and click **New Item**. -Then choose **NPM Configuration File** and use the default name `package.json`. -Inside `"devDependencies"` add "gulp" and "del": +Inside the `"devDependencies"` section of the `package.json` file, add *gulp* and *del* -```json +``` "devDependencies": { - "gulp": "3.9.0", - "del": "2.2.0" + "gulp": "4.0.2", + "del": "5.1.0" } ``` -Visual Studio should start installing gulp and del as soon as you save the file. -If not, right-click package.json and then **Restore Packages**. +Visual Studio should start installing gulp and del as soon as you save the file. If not, right-click package.json and then Restore Packages. -### Set up gulp +After you should see an `npm` folder in your solution explorer -Finally, add a new JavaScript file named `gulpfile.js`. -Put the following code inside: +![](../../assets/images/tutorials/aspnet/npm.png) + +*Set up gulp* # + +Right click on the project and click **New Item**. Then choose **JavaScript File** and use the name of `gulpfile.js` ```js /// @@ -179,21 +150,21 @@ gulp.task('default', function () { gulp.src(paths.scripts).pipe(gulp.dest('wwwroot/scripts')) }); ``` +The first line tells Visual Studio to run the task ‘default’ after the build finishes. It will also run the ‘clean’ task when you ask Visual Studio to clean the build. -The first line tells Visual Studio to run the task 'default' after the build finishes. -It will also run the 'clean' task when you ask Visual Studio to clean the build. +Now right-click on `gulpfile.js` and click Task Runner Explorer. -Now right-click on `gulpfile.js` and click **Task Runner Explorer**. -If 'default' and 'clean' tasks don't show up, refresh the explorer: +![](../../assets/images/tutorials/aspnet/taskrunner.png) -![Refresh Task Runner Explorer](../../assets/images/tutorials/aspnet/task-runner-explorer.png) +If ‘default’ and ‘clean’ tasks don’t show up, refresh the explorer: -## Write an HTML page +![](../../assets/images/tutorials/aspnet/taskrunnerrefresh.png) -Add a New Item named `index.html` inside `wwwroot`. -Use the following code for `index.html`: +### Write a HTML page -```html +Right click on the `wwwroot` folder (if you don't see the folder try building the project) and add a New Item named `index.html` inside. Use the following code for `index.html ` + +``` @@ -211,198 +182,22 @@ Use the following code for `index.html`: ``` -## Test +### Test -1. Run the project. -2. You should see a message when you type in the input boxes: +1. Run the project +2. As you type on the boxes you should see the message appear/change! -![Picture of running demo](../../assets/images/tutorials/aspnet/running-demo.png) +![](https://media.giphy.com/media/U3mTibRAx34DG3zhAN/giphy.gif) -## Debug +### Debug -1. In Edge, press F12 and click the **Debugger** tab. +1. In Edge, press F12 and click the Debugger tab. 2. Look in the first localhost folder, then scripts/app.ts -3. Put a breakpoint on the line with `return`. +3. Put a breakpoint on the line with return. 4. Type in the boxes and confirm that the breakpoint hits in TypeScript code and that inspection works correctly. -![Demo paused on breakpoint](../../assets/images/tutorials/aspnet/paused-demo.png) - -That's all you need to know to include basic TypeScript in your ASP.NET project. -Next we'll include Angular and write a simple Angular app. - -# Add Angular 2 - -## Add NPM dependencies - -Add Angular 2 and SystemJS to `dependencies` in `package.json`. - -For VS2015, the new `dependencies` list: - -```json - "dependencies": { - "angular2": "2.0.0-beta.11", - "systemjs": "0.19.24", - "gulp": "3.9.0", - "del": "2.2.0" - }, -``` - -For VS2017, due to the deprecation of peer dependencies in NPM3, we need to list Angular 2's peer dependencies directly as dependencies as well: - -```json - "dependencies": { - "angular2": "2.0.0-beta.11", - "reflect-metadata": "0.1.2", - "rxjs": "5.0.0-beta.2", - "zone.js": "^0.6.4", - "systemjs": "0.19.24", - "gulp": "3.9.0", - "del": "2.2.0" - }, -``` - -## Update tsconfig.json - -Now that Angular 2 and its dependencies are installed, we need to enable TypeScript's experimental support for decorators. -We also need to add declarations for ES2015, since Angular uses core-js for things like `Promise`. -In the future decorators will be the default and these settings will not be needed. - -Add `"experimentalDecorators": true, "emitDecoratorMetadata": true` to the `"compilerOptions"` section. -Next, add `"lib": ["es2015", "es5", "dom"]` to `"compilerOptions"` as well to bring in declarations from ES2015. -Finally, we'll need to add a new entry in `"files"` for another file, `"./model.ts"`, which we'll create. -Our tsconfig should now look like this: - -```json -{ - "compilerOptions": { - "noImplicitAny": true, - "noEmitOnError": true, - "sourceMap": true, - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "target": "es5", - "lib": [ - "es2015", "es5", "dom" - ] - }, - "files": [ - "./app.ts", - "./model.ts", - "./main.ts" - ], - "compileOnSave": true -} -``` - -## Add Angular to the gulp build - -Finally, we need to make sure that the Angular files are copied as part of the build. -We need to add: - -1. The paths to the library files. -2. Add a `lib` task to pipe the files to `wwwroot`. -3. Add a dependency on `lib` to the `default` task. +![](../../assets/images/tutorials/aspnet/debugger.png) -The updated `gulpfile.js` should look like this: +Congrats you've built your own .NET Core project with a TypeScript frontend. -```xml -/// -/* -This file is the main entry point for defining Gulp tasks and using Gulp plugins. -Click here to learn more. http://go.microsoft.com/fwlink/?LinkId=518007 -*/ - -var gulp = require('gulp'); -var del = require('del'); - -var paths = { - scripts: ['scripts/**/*.js', 'scripts/**/*.ts', 'scripts/**/*.map'], - libs: ['node_modules/angular2/bundles/angular2.js', - 'node_modules/angular2/bundles/angular2-polyfills.js', - 'node_modules/systemjs/dist/system.src.js', - 'node_modules/rxjs/bundles/Rx.js'] -}; - -gulp.task('lib', function () { - gulp.src(paths.libs).pipe(gulp.dest('wwwroot/scripts/lib')); -}); - -gulp.task('clean', function () { - return del(['wwwroot/scripts/**/*']); -}); - -gulp.task('default', ['lib'], function () { - gulp.src(paths.scripts).pipe(gulp.dest('wwwroot/scripts')); -}); -``` - -Again, make sure that Task Runner Explorer sees the new `lib` task after you save the gulpfile. - -## Write a simple Angular app in TypeScript - -First, change the code in `app.ts` to: - -```ts -import {Component} from "angular2/core" -import {MyModel} from "./model" - -@Component({ - selector: `my-app`, - template: `
Hello from {{getCompiler()}}
` -}) -export class MyApp { - model = new MyModel(); - getCompiler() { - return this.model.compiler; - } -} -``` - -Then add another TypeScript file in `scripts` named `model.ts`: - -```ts -export class MyModel { - compiler = "TypeScript"; -} -``` - -And then another TypeScript file in `scripts` named `main.ts`: - -```ts -import {bootstrap} from "angular2/platform/browser"; -import {MyApp} from "./app"; -bootstrap(MyApp); -``` - -Finally, change the code in `index.html` to the following: - -```html - - - - - - - - - - - - - Loading... - - -``` -This loads the app. -When you run the ASP.NET application you should see a div that says "Loading..." and then updates to say "Hello from TypeScript". diff --git a/pages/tutorials/React & Webpack.md b/pages/tutorials/React & Webpack.md index ab6cbbab3..6ec73bd71 100644 --- a/pages/tutorials/React & Webpack.md +++ b/pages/tutorials/React & Webpack.md @@ -1,6 +1,6 @@ This guide will teach you how to wire up TypeScript with [React](https://reactjs.org/) and [webpack](https://webpack.js.org/). -If you're starting a brand new project, take a look at the [React Quick Start guide](/samples/index.html) first. +If you're starting a brand new project, take a look at the [React Quick Start guide](https://create-react-app.dev/docs/adding-typescript) first. Otherwise, we assume that you're already using [Node.js](https://nodejs.org/) with [npm](https://www.npmjs.com/). @@ -81,9 +81,6 @@ source-map-loader uses any sourcemap outputs from TypeScript to inform webpack w This will allow you to debug your final output file as if you were debugging your original TypeScript source code. Please note that ts-loader is not the only loader for typescript. -You could instead use [awesome-typescript-loader](https://www.npmjs.com/package/awesome-typescript-loader). - -Read about the differences between them [here](https://github.com/s-panferov/awesome-typescript-loader#differences-between-ts-loader). Notice that we installed TypeScript as a development dependency. We could also have linked TypeScript to a global copy with `npm link typescript`, but this is a less common scenario. diff --git a/pages/tutorials/React.md b/pages/tutorials/React.md index 3baf18f83..3340a2114 100644 --- a/pages/tutorials/React.md +++ b/pages/tutorials/React.md @@ -252,16 +252,18 @@ Enzyme is similar, but builds on jsdom and makes it easier to make certain queri Let's install it as a development-time dependency. ```sh -npm install -D enzyme @types/enzyme react-addons-test-utils +npm install -D enzyme @types/enzyme enzyme-adapter-react-16 @types/enzyme-adapter-react-16 react-addons-test-utils ``` Notice we installed packages `enzyme` as well as `@types/enzyme`. The `enzyme` package refers to the package containing JavaScript code that actually gets run, while `@types/enzyme` is a package that contains declaration files (`.d.ts` files) so that TypeScript can understand how you can use Enzyme. You can learn more about `@types` packages [here](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html). -We also had to install `react-addons-test-utils`. +We had to install `react-addons-test-utils`. This is something `enzyme` expects to be installed. +We also had to make sure `esModuleInterop` is set to `true` in the `tsconfig.json` + Now that we've got Enzyme set up, let's start writing our test! Let's create a file named `src/components/Hello.test.tsx`, adjacent to our `Hello.tsx` file from earlier. @@ -270,8 +272,11 @@ Let's create a file named `src/components/Hello.test.tsx`, adjacent to our `Hell import * as React from 'react'; import * as enzyme from 'enzyme'; +import Adapter from 'enzyme-adapter-react-16'; import Hello from './Hello'; +Enzyme.configure({ adapter: new Adapter() }); + it('renders the correct text when no enthusiasm level is given', () => { const hello = enzyme.shallow(); expect(hello.find(".greeting").text()).toEqual('Hello Daniel!') diff --git a/pages/tutorials/tsconfig.json.md b/pages/tutorials/tsconfig.json.md index 886a6d86f..803659ff5 100644 --- a/pages/tutorials/tsconfig.json.md +++ b/pages/tutorials/tsconfig.json.md @@ -6,11 +6,14 @@ A project is compiled in one of the following ways: ## Using tsconfig.json -* By invoking tsc with no input files, in which case the compiler searches for the `tsconfig.json` file starting in the current directory and continuing up the parent directory chain. -* By invoking tsc with no input files and a `--project` (or just `-p`) command line option that specifies the path of a directory containing a `tsconfig.json` file, or a path to a valid `.json` file containing the configurations. +* By invoking `tsc` with no input files, in which case the compiler searches for the `tsconfig.json` file starting in the current directory and continuing up the parent directory chain. +* By invoking `tsc` with no input files and a `--project` (or just `-p`) command line option that specifies the path of a directory containing a `tsconfig.json` file, or a path to a valid `.json` file containing the configurations. When input files are specified on the command line, `tsconfig.json` files are ignored. +If you're looking for more information about the compiler options in a tsconfig, check out the TSConfig Reference beta +available in [the v2 site](https://www.staging-typescript.org/tsconfig). + ## Examples Example `tsconfig.json` files: @@ -144,6 +147,7 @@ A `tsconfig.json` file can inherit configurations from another file using the `e The `extends` is a top-level property in `tsconfig.json` (alongside `compilerOptions`, `files`, `include`, and `exclude`). `extends`' value is a string containing a path to another configuration file to inherit from. +The path may use Node.js style resolution. The configuration from the base file are loaded first, then overridden by those in the inheriting config file. If a circularity is encountered, we report an error.