From b3796431b9bc4b80c3956437f150a149c6c60767 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 6 Aug 2015 16:07:24 -0700 Subject: [PATCH 0001/1736] Updated Home (markdown) --- Home.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Home.md b/Home.md index be316e72..03c589e7 100644 --- a/Home.md +++ b/Home.md @@ -11,6 +11,7 @@ * [Compiler Options] (Compiler Options) * [TypeScript Editor Support](TypeScript-Editor-Support) * [tsconfig.json] (tsconfig.json) +* [Using TypeScript with ASP.NET v5](Using-TypeScript-With-ASP.NET-5) # Advanced Topics From 346883aae00eb0a4356e3be03cb1866e8784ba32 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 6 Aug 2015 16:11:18 -0700 Subject: [PATCH 0002/1736] Updated Using TypeScript With ASP.NET 5 (markdown) --- Using-TypeScript-With-ASP.NET-5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Using-TypeScript-With-ASP.NET-5.md b/Using-TypeScript-With-ASP.NET-5.md index 2da3ce0e..88ba26b6 100644 --- a/Using-TypeScript-With-ASP.NET-5.md +++ b/Using-TypeScript-With-ASP.NET-5.md @@ -13,7 +13,7 @@ This is where we'll add the TypeScript files and the [tsconfig.json](tsconfig.js ![Project layout](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/project.png) -Finally we have to add the following option to the *"compilerOptions"* node in the `tsconfig.json` file to redirect the compiler output to the `wwwroot` folder: +Finally we have to add the following option to the `"compilerOptions"` node in the `tsconfig.json` file to redirect the compiler output to the `wwwroot` folder: ```json "outDir": "../wwwroot/" From b83293c8ae4dec5dea86a840cf5e815c51d588ed Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 6 Aug 2015 16:13:35 -0700 Subject: [PATCH 0003/1736] CASE SENSITIVE, PAUL. --- .../{Compile-on-Save.png => compile-on-save.png} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename aspnet-screenshots/{Compile-on-Save.png => compile-on-save.png} (100%) diff --git a/aspnet-screenshots/Compile-on-Save.png b/aspnet-screenshots/compile-on-save.png similarity index 100% rename from aspnet-screenshots/Compile-on-Save.png rename to aspnet-screenshots/compile-on-save.png From e4c392af445ffb755c5cbf11010f3de46e930964 Mon Sep 17 00:00:00 2001 From: Louis Lewis Date: Fri, 7 Aug 2015 03:08:19 +0200 Subject: [PATCH 0004/1736] ASP.NET 5 Detailed Added more information and extra screenshots to cover popular questions. --- Using-TypeScript-With-ASP.NET-5.md | 31 +++++++++++++++++++++++-- aspnet-screenshots/add-tsconfig.png | Bin 0 -> 36347 bytes aspnet-screenshots/virtual-project.png | Bin 0 -> 14239 bytes 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 aspnet-screenshots/add-tsconfig.png create mode 100644 aspnet-screenshots/virtual-project.png diff --git a/Using-TypeScript-With-ASP.NET-5.md b/Using-TypeScript-With-ASP.NET-5.md index 88ba26b6..c54e8e64 100644 --- a/Using-TypeScript-With-ASP.NET-5.md +++ b/Using-TypeScript-With-ASP.NET-5.md @@ -9,7 +9,11 @@ We start by creating a new empty ASP.NET v5 project in Visual Studio 2015, of yo ![Create new Empty ASP.NET Project](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/new-project.png) Next add a `scripts` folder to the root of our project. -This is where we'll add the TypeScript files and the [tsconfig.json](tsconfig.json.md) file to set our compiler options. +This is where we'll add the TypeScript files and the [tsconfig.json](tsconfig.json.md) file to set our compiler options. Please note that the names and locations of +the folders are pertinent to get the solution working correctly. To add a tsconfig.json file, simply right click on the 'scripts' folder, navigate to 'Add', then 'New Item'. +Under Client-side, you can find it, as can be seen below. + +![Project layout](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/add-tsconfig.png) ![Project layout](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/project.png) @@ -19,11 +23,34 @@ Finally we have to add the following option to the `"compilerOptions"` node in t "outDir": "../wwwroot/" ``` +This is potentially what a tsconfig.json might look like once configured. + +```json + { + "compilerOptions": { + "noImplicitAny": false, + "noEmitOnError": true, + "removeComments": false, + "sourceMap": true, + "target": "es5", + "outDir": "../wwwroot" + } + } +``` + Now if we build our project, you'll notice the `app.js` and `app.js.map` files were created in the root of our `wwwroot` folder. ![Files after build](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/postbuild.png) +##Project vs Virtual Project +When adding a tsconfig.json file, it is vital to understand that this creates a virtual typescript project within the folder +where the tsconfig.json is located. TypeScript files that are considered part of this virtual project, will not be compiled when +saving changes. TypeScript files that are outside of the folder containing the tsconfig.json are considered not to be part of the virtual project. +In the image below, the virtual project can be visualized, and is the that which is contained within the blue rectangle. + +![Compile on Save](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/virtual-project.png) + ##Compile on Save -In order to enable *Compile on Save* for ASP.NET v5 projects, you have to enable *Compile on Save* for TypeScript files which are not part of a project. The setting for the selected module type in that dialog will be ignored if a `tsconfig.json` file is part of the project. +In order to enable *Compile on Save* for ASP.NET v5 projects, you have to enable *Compile on Save* for TypeScript files which are not part of a virtual TypeScript project. The setting for the selected module type in that dialog will be ignored if a `tsconfig.json` file is part of the project. ![Compile on Save](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/compile-on-save.png) \ No newline at end of file diff --git a/aspnet-screenshots/add-tsconfig.png b/aspnet-screenshots/add-tsconfig.png new file mode 100644 index 0000000000000000000000000000000000000000..96b6534dd6afa3b20dcc005265fb3808a5823af7 GIT binary patch literal 36347 zcmeFZXIN8P*ESllV45eZ#H zL27_VXhJB48cN7n?5+E8tIvCV@1Jvid?(k%1!1i<$1G!xagTe9xk9xyl_*bMI0*uQ zC{>hi=zu_n%RnHqnB!!?e-KpN9Kf$bZaPZWLB$`K=7BFqY_Dlt1A)q-PVHG91-_qf zQ8sh~fv8#zeh#%ezp@5_BA%(-xTfoEwnVgyGqrs%7rN7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Ihv6M?k4$FDP<0(VKpP$Z5pE=R3|mHz0vRr_+IQ&Z&sFpB9R~2-7tr4IK)i2I z6@FZ7??d}WxNK;xC`8oRBO}w>AwDD{BbDCvA#XLThcA3Co?zWmMzUeDCts*h#Gckh zt(+bvF-}oI0#$aF14ODxK`7|jPWuZTgWd2#BU!@|65w?-c^gKFwb|)$08$oCx0Zd$ zag>8f!T0)|Q+)5_%k-?5^}yNdXFSuc?pcp-SD)VD-FQE%@urx_r+7sP+~+{w(kJ+f z!>9!5_mODF2gv$EH;_W}RN#wku|%9#X5xoYWl&VSiGgP`?WBk4;=3z(DrUCY5kn@M z^{QCs4S^43>OOv&Jtg+V@bFrS|0sn1RT1UFnGHNbE+P|qKMf)l8tww_Y&JO982q7Zcpb`aMl{n z&JyE0MaAMLy7^MkE&yZTdDzr!4ZUUramZS2fQZyj=fU)QXhYHjg7zi}C=JuMS`%(Y z%kD~oQUF9pa~itdGDK{<(?jfDe66M_-1iR>n)HKhH$2Trjq?uo|FN zVD+*=92BbYfJ11&<{q^k#^Y!1#`P>4k$=;I1eZ%q6X_5vIc??80L t`s|+{|GpICUu!b{9~*5Kd!u(G+eyXYGFO3)=s(qA0F Date: Fri, 7 Aug 2015 16:30:18 -0700 Subject: [PATCH 0005/1736] Updated Coding guidelines (markdown) From 7912fa2a47f0e89aa5f00bf616cbbb8c2829cfff Mon Sep 17 00:00:00 2001 From: Dan Quirk Date: Fri, 7 Aug 2015 16:30:36 -0700 Subject: [PATCH 0006/1736] Updated Coding guidelines (markdown) From 2b9efd6b35d620bb5d4e0af00bc0ba7dbbc1f039 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 7 Aug 2015 16:37:45 -0700 Subject: [PATCH 0007/1736] Update Using-TypeScript-With-ASP.NET-5.md --- Using-TypeScript-With-ASP.NET-5.md | 52 ++++++++++++++++-------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/Using-TypeScript-With-ASP.NET-5.md b/Using-TypeScript-With-ASP.NET-5.md index c54e8e64..0cbcf321 100644 --- a/Using-TypeScript-With-ASP.NET-5.md +++ b/Using-TypeScript-With-ASP.NET-5.md @@ -9,13 +9,14 @@ We start by creating a new empty ASP.NET v5 project in Visual Studio 2015, of yo ![Create new Empty ASP.NET Project](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/new-project.png) Next add a `scripts` folder to the root of our project. -This is where we'll add the TypeScript files and the [tsconfig.json](tsconfig.json.md) file to set our compiler options. Please note that the names and locations of -the folders are pertinent to get the solution working correctly. To add a tsconfig.json file, simply right click on the 'scripts' folder, navigate to 'Add', then 'New Item'. -Under Client-side, you can find it, as can be seen below. +This is where we'll add the TypeScript files and the [`tsconfig.json`](tsconfig.json.md) file to set our compiler options. +Please note that the names and locations of the folders are pertinent to get the solution working correctly. +To add a `tsconfig.json` file, simply right click on the `scripts` folder, navigate to `Add`, then `New Item`. +Under `Client-side`, you can find it, as can be seen below. -![Project layout](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/add-tsconfig.png) +![Adding a 'tsconfig.json' file in Visual Studio](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/add-tsconfig.png) -![Project layout](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/project.png) +![A project in Visual Studio's Solution Explorer](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/project.png) Finally we have to add the following option to the `"compilerOptions"` node in the `tsconfig.json` file to redirect the compiler output to the `wwwroot` folder: @@ -26,31 +27,34 @@ Finally we have to add the following option to the `"compilerOptions"` node in t This is potentially what a tsconfig.json might look like once configured. ```json - { - "compilerOptions": { - "noImplicitAny": false, - "noEmitOnError": true, - "removeComments": false, - "sourceMap": true, - "target": "es5", - "outDir": "../wwwroot" - } - } +{ + "compilerOptions": { + "noImplicitAny": false, + "noEmitOnError": true, + "removeComments": false, + "sourceMap": true, + "target": "es5", + "outDir": "../wwwroot" + } +} ``` Now if we build our project, you'll notice the `app.js` and `app.js.map` files were created in the root of our `wwwroot` folder. ![Files after build](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/postbuild.png) -##Project vs Virtual Project -When adding a tsconfig.json file, it is vital to understand that this creates a virtual typescript project within the folder -where the tsconfig.json is located. TypeScript files that are considered part of this virtual project, will not be compiled when -saving changes. TypeScript files that are outside of the folder containing the tsconfig.json are considered not to be part of the virtual project. -In the image below, the virtual project can be visualized, and is the that which is contained within the blue rectangle. +## Project vs Virtual Project -![Compile on Save](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/virtual-project.png) +When adding a `tsconfig.json` file, it is vital to understand that this creates a virtual typescript project within the folder where the `tsconfig.json` is located. +TypeScript files that are considered part of this virtual project will not be compiled when saving changes. +TypeScript files that are *outside* of the folder containing `tsconfig.json` are *not* considered part of the virtual project. +In the image below, the virtual project can be visualized, and is the that which is contained within the red rectangle. -##Compile on Save -In order to enable *Compile on Save* for ASP.NET v5 projects, you have to enable *Compile on Save* for TypeScript files which are not part of a virtual TypeScript project. The setting for the selected module type in that dialog will be ignored if a `tsconfig.json` file is part of the project. +![A virtual project in Visual Studio's Solution Explorer](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/virtual-project.png) -![Compile on Save](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/compile-on-save.png) \ No newline at end of file +## Compile on Save + +In order to enable *Compile on Save* for ASP.NET v5 projects, you have to enable *Compile on Save* for TypeScript files which are not part of a virtual TypeScript project. +The setting for the selected module type in that dialog will be ignored if a `tsconfig.json` file is part of the project. + +![Compile on Save](https://raw.githubusercontent.com/wiki/Microsoft/TypeScript/aspnet-screenshots/compile-on-save.png) From 40fa686b6921e75c7f9d525350b249cc76928434 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 7 Aug 2015 16:38:50 -0700 Subject: [PATCH 0008/1736] Make the rectangle red. --- aspnet-screenshots/virtual-project.png | Bin 14239 -> 14253 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/aspnet-screenshots/virtual-project.png b/aspnet-screenshots/virtual-project.png index 84ab986f0e7975848997c7942a62ddcc99d8c8de..d5069dcbc6226ae3798d14728668898cdc561494 100644 GIT binary patch literal 14253 zcmajGcUV*1`Ynng2nvXFLRX43LArF1DosHMNGFtp-jOa{Ady}INCzna3|){eq4yFx zN-qJVcertXXYaG`{oQ-+A9?a*mAU48*E`1??-(m2|OR_iW@e%l*&O2N{@l^ZomuEP|8rrhFaawZ98qpn1-W-0Om@EP#V`Qj>xb5hY`3i{ zACr?zhiM^rDvdMVf>7B=n*r+-%J!>IlCKB^$y}(_9{!(p&S>sD=W3rw3$g_-S+)g_7G;IKez2 zaoWTB_)iP6kwi+bd4jJs$iJCPL6tlrNWw>C&TUyt`Yw%@w^?=Ozq-5_K|Lrlg6edvR#aXl2X`-P1f zrRPkx)+_j_%sX2@>`}DjJGccH(q>RLGlnFLct58_#)XCkanu4Cp*9qN17W)7)Oh=# z=)D(9Ckwg>N4|ET#M_bS%t22fz}Cv$r1IZ0$1J7X&M93ZMIw6b&!yMgMPWwyGBV%< zJnqVbW@!VN7*oi@CEC#Iwp1T|9)flHdgV)+)t1(W-o%+5I{vSy1pvVoz=oh`WOZHkezL*zp-bMcMMf*Uwq4SMP4}U$U zm>~6vY80IHwm>aa>cua3X8|V%mw~ywkB7{%{U%->KM`@YFZ3E_j7GNx@P&+sq|wlA zaJ_x%5QaQqMbTt0nmp;>d@hr@KXi=P2?+Fco?t^}Ppe;XXzhFV)_%B;OTyc{6>wlV zd5huDx+H1l#N)C#l=8tV3m8>M%f(;&71E@OymvJ$E3hZ+#h8ajQjs>x&Zx8D)sEA=w zrx)8C8IS|r3by1)ZY#1U+o;^O6zh!{u_16zqSnq&N~yATu(!d$1=mR( z-B#Whms&gnt-iglvcPwk_Z{izaqQ7_I4EK4OZIppN;V#qoEM1<)7hB-#$>*%3a@w` zLgNmj&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Z7??d}WxNK;xC`8oRBO}w>AwDD{BbDCvA#XLThcA3Co?zWmMzUeDCts*h#Gckh zt(+bvF-}oI0#$aF14ODxK`7|jPWuZTgWd2#BU!@|65w?-c^gKFwb|)$08$oCx0Zd$ zag>8f!T0)|Q+)5_%k-?5^}yNdXFSuc?pcp-SD)VD-FQE%@urx_r+7sP+~+{w(kJ+f z!>9!5_mODF2gv$EH;_W}RN#wku|%9#X5xoYWl&VSiGgP`?WBk4;=3z(DrUCY5kn@M z^{QCs4S^43>OOv&Jtg+V@bFrS|0sn1RT1UFnGHNbE+P|qKMf)l8tww_Y&JO982q7Zcpb`aMl{n z&JyE0MaAMLy7^MkE&yZTdDzr!4ZUUramZS2fQZyj=fU)QXhYHjg7zi}C=JuMS`%(Y z%kD~oQUF9pa~itdGDK{<(?jfDe66M_-1iR>n)HKhH$2Trjq?uo|FN zVD+*=92BbYfJ11&<{q^k#^Y!1#`P>4k$=;I1eZ%q6X_5vIc??80L t`s|+{|GpICUu!b{9~*5Kd!u(G+eyXYGFO3)=s(qA0F Date: Tue, 11 Aug 2015 18:13:58 -0400 Subject: [PATCH 0009/1736] Language and Tone section in the wiki As per [a comment](https://github.com/Microsoft/TypeScript/issues/4238#issuecomment-130068114) by @DanielRosenwasser I think we should put something related to language and tone in the wiki section. How this sounds? --- Contributing-to-TypeScript.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Contributing-to-TypeScript.md b/Contributing-to-TypeScript.md index 6ca36152..20f80eb7 100644 --- a/Contributing-to-TypeScript.md +++ b/Contributing-to-TypeScript.md @@ -31,6 +31,9 @@ Declined suggestions will have the `Declined` label along with one of the follow Issues that are not bugs or suggestions will be labelled appropriately (`Question`, `By Design`, `External`) and closed. Please use [Stack Overflow](http://stackoverflow.com/questions/tagged/typescript) for TypeScript questions. +### Language and Tone +In order to keep the conversation clear and transparent in the issues sections, limit discussion to English and keep things on topic with the issue. **Your tone should be courteous and professional at all times.** + ### Documentation For any new features, please: From 0a36aca671fa0c34863430be257404e83b759c8c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 11 Aug 2015 15:52:27 -0700 Subject: [PATCH 0010/1736] Break lines, touch up wording. --- Contributing-to-TypeScript.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Contributing-to-TypeScript.md b/Contributing-to-TypeScript.md index 20f80eb7..32494958 100644 --- a/Contributing-to-TypeScript.md +++ b/Contributing-to-TypeScript.md @@ -32,14 +32,16 @@ Declined suggestions will have the `Declined` label along with one of the follow Issues that are not bugs or suggestions will be labelled appropriately (`Question`, `By Design`, `External`) and closed. Please use [Stack Overflow](http://stackoverflow.com/questions/tagged/typescript) for TypeScript questions. ### Language and Tone -In order to keep the conversation clear and transparent in the issues sections, limit discussion to English and keep things on topic with the issue. **Your tone should be courteous and professional at all times.** + +In order to keep the conversation clear and transparent, limit discussion to English and keep things on topic with the issue. +Be considerate to others and try to be courteous and professional at all times. ### Documentation For any new features, please: * Add a link to the Roadmap: https://github.com/Microsoft/TypeScript/wiki/Roadmap * Add a blurb to what's new page: https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript -* Add a section to the Handbook, if big enough: https://github.com/Microsoft/TypeScript-Handbook +* Add a section to the Handbook, if big enough: https://github.com/Microsoft/TypeScript-Handbook * For breaking changes: * Add a breaking change notice: https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes * or to the API breaking changes pages: https://github.com/Microsoft/TypeScript/wiki/API-Breaking-Changes From dd6aaa82d6587b5db6949ac89898f2b90baf8d61 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 11 Aug 2015 15:54:33 -0700 Subject: [PATCH 0011/1736] Lines after headers. --- Contributing-to-TypeScript.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Contributing-to-TypeScript.md b/Contributing-to-TypeScript.md index 32494958..880ee7db 100644 --- a/Contributing-to-TypeScript.md +++ b/Contributing-to-TypeScript.md @@ -1,15 +1,19 @@ There are three great ways to contribute to the TypeScript project: logging bugs, submitting pull requests, and creating suggestions. ### Logging Bugs + To log a bug, just use the GitHub issue tracker. Confirmed bugs will be labelled with the `Bug` label. Please include code to reproduce the issue and a description of what you expected to happen. ### Pull Requests + Before we can accept a pull request from you, you'll need to sign the Contributor License Agreement (CLA). See the "Legal" section of the [CONTRIBUTING.md guide](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). That document also outlines the technical nuts and bolts of submitting a pull request. Be sure to follow our [[Coding Guidelines|coding-guidelines]]. ### Suggestions + We're also interested in your feedback in future of TypeScript. You can submit a suggestion or feature request through the issue tracker. To make this process more effective, we're asking that these include more information to help define them more clearly. Start by reading the [[TypeScript Design Goals]] and refer to [[Writing Good Design Proposals]] for information on how to write great feature proposals. ### Issue Tracking 101 + Unlabelled issues haven't been looked at by a TypeScript coordinator. You can expect to see them labelled within a few days of being logged. Issues with the `Bug` label are considered to be defects. Once they have the `Bug` label, they'll either be assigned to a TypeScript developer and assigned a milestone, or put in the Community milestone, indicating that we're accepting pull requests for this bug. Community bugs are a great place to start if you're interested in making a code contribution to TypeScript. From de095f4b0406eb25042c683faecf11ab2c7f3e1b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 11 Aug 2015 15:54:59 -0700 Subject: [PATCH 0012/1736] Rename section 'Discussion'. --- Contributing-to-TypeScript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contributing-to-TypeScript.md b/Contributing-to-TypeScript.md index 880ee7db..fb52bb30 100644 --- a/Contributing-to-TypeScript.md +++ b/Contributing-to-TypeScript.md @@ -35,7 +35,7 @@ Declined suggestions will have the `Declined` label along with one of the follow Issues that are not bugs or suggestions will be labelled appropriately (`Question`, `By Design`, `External`) and closed. Please use [Stack Overflow](http://stackoverflow.com/questions/tagged/typescript) for TypeScript questions. -### Language and Tone +### Discussion In order to keep the conversation clear and transparent, limit discussion to English and keep things on topic with the issue. Be considerate to others and try to be courteous and professional at all times. From e12f5392b377e33144d6d233eb997b0000a4621a Mon Sep 17 00:00:00 2001 From: James Brantly Date: Tue, 11 Aug 2015 19:04:58 -0400 Subject: [PATCH 0013/1736] Add JSX page --- JSX.md | 264 ++++++++++++++++++++++++++++++++++++++++++++++++++++ _Sidebar.md | 1 + 2 files changed, 265 insertions(+) create mode 100644 JSX.md diff --git a/JSX.md b/JSX.md new file mode 100644 index 00000000..fbbca1b3 --- /dev/null +++ b/JSX.md @@ -0,0 +1,264 @@ +> This feature is upcoming in TypeScript 1.6. If you would like to try it today, use the [nightly package](http://blogs.msdn.com/b/typescript/archive/2015/07/27/introducing-typescript-nightlies.aspx). + +# Introduction + +JSX is an embeddable XML-like syntax. It is meant to be transpiled into valid JavaScript but the semantics of that transpilation are implementation-specific. JSX came to popularity with the React library but has since seen other applications. TypeScript supports embedding, type checking and optionally transpiling JSX. + +# Basic usage + +In order to use JSX you must do two things. + +1. Name your files with the `.tsx` extension +2. Enable the `jsx` option + +TypeScript ships with two JSX modes: `preserve` and `react`. These modes only affect the emit stage. The `preserve` mode will keep the JSX as part of the output to be further consumed by another transpiler. Additionally the output will have a `.jsx` file extension. The `react` mode will emit `React.createElement`, does not need to go through a JSX transformation before use, and the output has a `.js` file extension. + + + + + + + + + + + + + + + + + + + + + +
ModeInputOutputFile Extension
preserve<div /><div />.jsx
react<div />React.createElement("div").js
+ +You can specify this mode either with either the `--jsx` command line flag or in your [tsconfig.json](https://github.com/Microsoft/TypeScript/wiki/tsconfig.json) file. + +>*Note: The identifier `React` is hardcoded, so you must make React available with an uppercase R.* + +# The `as` operator + +Since TypeScript uses angle brackets for type assertions, there is a conflict when parsing between type assertions and JSX. Consider the following code: + +```jsx +var foo = bar; + +``` + +Is this code creating a JSX element with the content of `bar;` or is it asserting that `bar` is of type `foo` and there is an invalid expression on line 2? To simplify cases like this, angle bracket type assertion is not available in `.tsx` files. So if the previous code were in a `.tsx` file it would be interpreted as a JSX element and if in a `.ts` file it would result in an error. To make up for this loss of functionality a new type assertion operator has been added: `as`. + +```typescript +var foo = bar as foo; +``` + +The `as` operator is available in both `.ts` and `.tsx` files. + +# Type Checking + +In order to understand type checking with JSX you must first understand intrinsic elements vs value-based elements. Given a JSX expression ``, is `expr` referring to something intrinsic to the environment (ie, a div or span in a DOM environment) or to a custom component that you've made? This is important for two reasons: + +1. For React, intrinsic elements are emitted as strings, like `React.createElement('div')`, whereas a component you've created is not: `React.createElement(MyComponent)`. +2. The types of the attributes being passed in the JSX element should be looked up differently. Intrinsic element attributes should be known *intrinsically* whereas components will likely want to specify their own set of attributes. + +TypeScript uses the [same convention that React does](http://facebook.github.io/react/docs/jsx-in-depth.html#html-tags-vs.-react-components) for distinguishing between these: An intrinsic element always begins with a lowercase letter, and a value-based element always begins with an uppercase letter. + +## Intrinsic elements + +Intrinsic elements are looked up on the special interface `JSX.IntrinsicElements`. By default, if this interface is not specified, then anything goes and intrinsic elements will not be type checked. However, if you specify the interface then intrinsic elements are looked up as a property on the interface. + +```typescript +declare module JSX { + interface IntrinsicElements { + foo: any + } +} + +; // ok +; // error +``` + +In the above example, `foo` will work fine but `bar` will result in an error since it has not been specified on the intrinsic elements interface. + +>*Note: You can also specify a catch-all string indexer on `JSX.IntrinsicElements`* + +## Value-based elements + +Value based elements are simply looked up by identifiers that are in scope. + +```typescript +import MyComponent = require('./myComponent'); + +; // ok +; // error +``` + +It is possible to limit the type of a value-based element. However, for this we must introduce two new terms: the *element class type* and the *element instance type*. + +Given ``, the *element class type* is the type of `Expr`. So in the example above, if `MyComponent` was an ES6 class the class type would be that class. If `MyComponent` was a factory function, the class type would be that function. + +Once the class type is established, the instance type is determined by the union of the return types of the class type's call signatures and construct signatures. So again, in the case of an ES6 class, the instance type would be the type of an instance of that class, and in the case of a factory function, it would be the type of the value returned from the function. + +```typescript +class MyComponent { + render() {} +} + +// use a construct signature +var myComponent = new MyComponent(); + +// element class type => MyComponent +// element instance type => { render: () => void } + +function MyFactoryFunction() { + return { + render: () => { + } + } +} + +// use a call signature +var myComponent = MyFactoryFunction(); + +// element class type => FactoryFunction +// element instance type => { render: () => void } +``` + +The element instance type is interesting because it must be assignable to `JSX.ElementClass` or it will result in an error. By default `JSX.ElementClass` is `{}`, but it can be augmented to limit the use of JSX to only those types that conform to the proper interface. + +```typescript +declare module JSX { + interface ElementClass { + render: any; + } +} + +class MyComponent { + render() {} +} +function MyFactoryFunction() { + return { render: () => {} } +} + +; // ok +; // ok + +class NotAValidComponent {} +function NotAValidFactoryFunction() { + return {}; +} + +; // error +; // error +``` + +## Attribute type checking + +The first step to type checking attributes is to determine the *element attributes type*. This is slightly different between intrinsic and value-based elements. + +For intrinsic elements, it is the type of the property on `JSX.IntrinsicElements` + +```typescript +declare module JSX { + interface IntrinsicElements { + foo: { bar?: boolean } + } +} + +// element attributes type for `foo` is `{bar?: boolean}` +; +``` + +For value-based elements, it is a bit more complex. It is determined by the type of a property on the *element instance type* that was previously determined. Which property to use is determined by `JSX.ElementAttributesProperty`. It should be declared with a single property. The name of that property is then used. + +```typescript +declare module JSX { + interface ElementAttributesProperty { + props; // specify the property name to use + } +} + +class MyComponent { + // specify the property on the element instance type + props: { + foo?: string; + } +} + +// element attributes type for `MyComponent` is `{foo?: string}` + +``` + +The element attribute type is used to type check the attributes in the JSX. Optional and required properties are supported. + +```typescript +declare module JSX { + interface IntrinsicElements { + foo: { requiredProp: string; optionalProp?: number } + } +} + +; // ok +; // ok +; // error, requiredProp is missing +; // error, requiredProp should be a string +; // error, unknownProp does not exist +; // ok, because `some-unknown-prop` is not a valid identifier +``` + +>*Note: If an attribute name is not a valid JS identifier (like a `data-*` attribute), it is not considered to be an error if it is not found in the element attributes type.* + +The spread operator also works: + +```jsx +var props = { requiredProp: 'bar' }; +; // ok + +var badProps = {}; +; // error +``` + +# The JSX result type + +By default the result of a JSX expression is typed as `any`. You can customize the type by specifying the `JSX.Element` interface. However, it is not possible to retrieve type information about the element, attributes or children of the JSX from this interface. It is a black box. + +# Escaping to TypeScript + +JSX in JavaScript allows you to escape to JavaScript by using curly braces `{ }`. JSX in TypeScript allows you to do the same thing, but you escape to TypeScript. That means transpilation features and type checking still work when embedded within JSX. + +```jsx +var a =
+ {['foo', 'bar'].map(i => {i/2})} +
+``` + +The above code will result in an error since you cannot divide a string by a number. The output, when using the `preserve` option, looks like: + +```jsx +var a =
+ {['foo', 'bar'].map(function (i) { return {i / 2}; })} +
+``` + +# React integration + +To use JSX with React you should use the [React typings](https://github.com/borisyankov/DefinitelyTyped/tree/master/react). These typings define the `JSX` namespace appropriately for use with React. + +```typescript +/// + +interface Props { + foo: string; +} + +class MyComponent extends React.Component { + render() { + return {this.props.foo} + } +} + +; // ok +; // error +``` \ No newline at end of file diff --git a/_Sidebar.md b/_Sidebar.md index 3685341b..952da9a5 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -17,6 +17,7 @@ * [[Declaration Merging]] * [[Type Inference]] * [[Type Compatibility]] +* [[JSX]] * [[Writing Definition Files]] **News** From 1394ef957bc00297871aecbfabf08c302d7d2253 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 11 Aug 2015 18:01:06 -0700 Subject: [PATCH 0014/1736] Fix up JSX page a bit. --- JSX.md | 154 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 91 insertions(+), 63 deletions(-) diff --git a/JSX.md b/JSX.md index fbbca1b3..bd923f07 100644 --- a/JSX.md +++ b/JSX.md @@ -1,8 +1,12 @@ -> This feature is upcoming in TypeScript 1.6. If you would like to try it today, use the [nightly package](http://blogs.msdn.com/b/typescript/archive/2015/07/27/introducing-typescript-nightlies.aspx). +> This feature is upcoming in TypeScript 1.6. +If you would like to try it today, use the [nightly package](http://blogs.msdn.com/b/typescript/archive/2015/07/27/introducing-typescript-nightlies.aspx). # Introduction -JSX is an embeddable XML-like syntax. It is meant to be transpiled into valid JavaScript but the semantics of that transpilation are implementation-specific. JSX came to popularity with the React library but has since seen other applications. TypeScript supports embedding, type checking and optionally transpiling JSX. +JSX is an embeddable XML-like syntax. +It is meant to be transformed into valid JavaScript but the semantics of that transformation are implementation-specific. +JSX came to popularity with the React library but has since seen other applications. +TypeScript supports embedding, type checking, and optionally compiling JSX directly into JavaScript. # Basic usage @@ -11,46 +15,38 @@ In order to use JSX you must do two things. 1. Name your files with the `.tsx` extension 2. Enable the `jsx` option -TypeScript ships with two JSX modes: `preserve` and `react`. These modes only affect the emit stage. The `preserve` mode will keep the JSX as part of the output to be further consumed by another transpiler. Additionally the output will have a `.jsx` file extension. The `react` mode will emit `React.createElement`, does not need to go through a JSX transformation before use, and the output has a `.js` file extension. - - - - - - - - - - - - - - - - - - - - - -
ModeInputOutputFile Extension
preserve<div /><div />.jsx
react<div />React.createElement("div").js
- -You can specify this mode either with either the `--jsx` command line flag or in your [tsconfig.json](https://github.com/Microsoft/TypeScript/wiki/tsconfig.json) file. - ->*Note: The identifier `React` is hardcoded, so you must make React available with an uppercase R.* +TypeScript ships with two JSX modes: `preserve` and `react`. +These modes only affect the emit stage. +The `preserve` mode will keep the JSX as part of the output to be further consumed by another transform step. +Additionally the output will have a `.jsx` file extension. +The `react` mode will emit `React.createElement`, does not need to go through a JSX transformation before use, and the output will have a `.js` file extension. + +Mode | Input | Output | File Extension +====================================================================== +`preserve` | `
` | `
` | `.jsx` +`react` | `
` | `React.createElement("div")` | `.js` + +You can specify this mode using either the `--jsx` command line flag or the corresponding option in your [tsconfig.json](https://github.com/Microsoft/TypeScript/wiki/tsconfig.json) file. + +> *Note: The identifier `React` is hard-coded, so you must make React available with an uppercase R.* # The `as` operator -Since TypeScript uses angle brackets for type assertions, there is a conflict when parsing between type assertions and JSX. Consider the following code: +Since TypeScript uses angle brackets for type assertions, there is a conflict when parsing between type assertions and JSX. +Consider the following code: -```jsx +```JSX var foo = bar; ``` -Is this code creating a JSX element with the content of `bar;` or is it asserting that `bar` is of type `foo` and there is an invalid expression on line 2? To simplify cases like this, angle bracket type assertion is not available in `.tsx` files. So if the previous code were in a `.tsx` file it would be interpreted as a JSX element and if in a `.ts` file it would result in an error. To make up for this loss of functionality a new type assertion operator has been added: `as`. +Is this code creating a JSX element with the content of `bar;`, or is it asserting that `bar` is of type `foo` and there is an invalid expression on line 2? +To simplify cases like this, angle bracket type assertions are not available in `.tsx` files. +As a result, in a `.tsx` file, the previous code would be interpreted as a JSX element, and in a `.ts` file it would result in an error. -```typescript +To make up for this loss of functionality in `.tsx` files, a new type assertion operator has been added: `as`. + +```TypeScript var foo = bar as foo; ``` @@ -58,19 +54,25 @@ The `as` operator is available in both `.ts` and `.tsx` files. # Type Checking -In order to understand type checking with JSX you must first understand intrinsic elements vs value-based elements. Given a JSX expression ``, is `expr` referring to something intrinsic to the environment (ie, a div or span in a DOM environment) or to a custom component that you've made? This is important for two reasons: +In order to understand type checking with JSX you must first understand the differnece between intrinsic elements value-based elements. +Given a JSX expression ``, `expr` may either refer to something intrinsic to the environment (e.g. a `div` or `span` in a DOM environment) or to a custom component that you've created. +This is important for two reasons: -1. For React, intrinsic elements are emitted as strings, like `React.createElement('div')`, whereas a component you've created is not: `React.createElement(MyComponent)`. +1. For React, intrinsic elements are emitted as strings (`React.createElement("div")`), whereas a component you've created is not (`React.createElement(MyComponent)`). 2. The types of the attributes being passed in the JSX element should be looked up differently. Intrinsic element attributes should be known *intrinsically* whereas components will likely want to specify their own set of attributes. -TypeScript uses the [same convention that React does](http://facebook.github.io/react/docs/jsx-in-depth.html#html-tags-vs.-react-components) for distinguishing between these: An intrinsic element always begins with a lowercase letter, and a value-based element always begins with an uppercase letter. +TypeScript uses the [same convention that React does](http://facebook.github.io/react/docs/jsx-in-depth.html#html-tags-vs.-react-components) for distinguishing between these. +An intrinsic element always begins with a lowercase letter, and a value-based element always begins with an uppercase letter. ## Intrinsic elements -Intrinsic elements are looked up on the special interface `JSX.IntrinsicElements`. By default, if this interface is not specified, then anything goes and intrinsic elements will not be type checked. However, if you specify the interface then intrinsic elements are looked up as a property on the interface. +Intrinsic elements are looked up on the special interface `JSX.IntrinsicElements`. +By default, if this interface is not specified, then anything goes and intrinsic elements will not be type checked. +However, if interface *is* present, then the name of the intrinsic element is looked up as a property on the `JSX.IntrinsicElements` interface. +For example: -```typescript -declare module JSX { +```TypeScript +declare namespace JSX { interface IntrinsicElements { foo: any } @@ -80,28 +82,40 @@ declare module JSX { ; // error ``` -In the above example, `foo` will work fine but `bar` will result in an error since it has not been specified on the intrinsic elements interface. +In the above example, `` will work fine but `` will result in an error since it has not been specified on `JSX.IntrinsicElements`. ->*Note: You can also specify a catch-all string indexer on `JSX.IntrinsicElements`* +*Note: You can also specify a catch-all string indexer on `JSX.IntrinsicElements`* as follows: + +```TypeScript +declare namespace JSX { + interface IntrinsicElements { + [elemName: string]: any; + } +} +``` ## Value-based elements Value based elements are simply looked up by identifiers that are in scope. -```typescript -import MyComponent = require('./myComponent'); +```TypeScript +import MyComponent from "./myComponent"; ; // ok ; // error ``` -It is possible to limit the type of a value-based element. However, for this we must introduce two new terms: the *element class type* and the *element instance type*. +It is possible to limit the type of a value-based element. +However, for this we must introduce two new terms: the *element class type* and the *element instance type*. -Given ``, the *element class type* is the type of `Expr`. So in the example above, if `MyComponent` was an ES6 class the class type would be that class. If `MyComponent` was a factory function, the class type would be that function. +Given ``, the *element class type* is the type of `Expr`. +So in the example above, if `MyComponent` was an ES6 class the class type would be that class. +If `MyComponent` was a factory function, the class type would be that function. -Once the class type is established, the instance type is determined by the union of the return types of the class type's call signatures and construct signatures. So again, in the case of an ES6 class, the instance type would be the type of an instance of that class, and in the case of a factory function, it would be the type of the value returned from the function. +Once the class type is established, the instance type is determined by the union of the return types of the class type's call signatures and construct signatures. +So again, in the case of an ES6 class, the instance type would be the type of an instance of that class, and in the case of a factory function, it would be the type of the value returned from the function. -```typescript +```TypeScript class MyComponent { render() {} } @@ -126,9 +140,10 @@ var myComponent = MyFactoryFunction(); // element instance type => { render: () => void } ``` -The element instance type is interesting because it must be assignable to `JSX.ElementClass` or it will result in an error. By default `JSX.ElementClass` is `{}`, but it can be augmented to limit the use of JSX to only those types that conform to the proper interface. +The element instance type is interesting because it must be assignable to `JSX.ElementClass` or it will result in an error. +By default `JSX.ElementClass` is `{}`, but it can be augmented to limit the use of JSX to only those types that conform to the proper interface. -```typescript +```TypeScript declare module JSX { interface ElementClass { render: any; @@ -156,11 +171,12 @@ function NotAValidFactoryFunction() { ## Attribute type checking -The first step to type checking attributes is to determine the *element attributes type*. This is slightly different between intrinsic and value-based elements. +The first step to type checking attributes is to determine the *element attributes type*. +This is slightly different between intrinsic and value-based elements. For intrinsic elements, it is the type of the property on `JSX.IntrinsicElements` -```typescript +```TypeScript declare module JSX { interface IntrinsicElements { foo: { bar?: boolean } @@ -171,9 +187,13 @@ declare module JSX { ; ``` -For value-based elements, it is a bit more complex. It is determined by the type of a property on the *element instance type* that was previously determined. Which property to use is determined by `JSX.ElementAttributesProperty`. It should be declared with a single property. The name of that property is then used. +For value-based elements, it is a bit more complex. +It is determined by the type of a property on the *element instance type* that was previously determined. +Which property to use is determined by `JSX.ElementAttributesProperty`. +It should be declared with a single property. +The name of that property is then used. -```typescript +```TypeScript declare module JSX { interface ElementAttributesProperty { props; // specify the property name to use @@ -191,9 +211,10 @@ class MyComponent { ``` -The element attribute type is used to type check the attributes in the JSX. Optional and required properties are supported. +The element attribute type is used to type check the attributes in the JSX. +Optional and required properties are supported. -```typescript +```TypeScript declare module JSX { interface IntrinsicElements { foo: { requiredProp: string; optionalProp?: number } @@ -212,7 +233,7 @@ declare module JSX { The spread operator also works: -```jsx +```JSX var props = { requiredProp: 'bar' }; ; // ok @@ -222,21 +243,27 @@ var badProps = {}; # The JSX result type -By default the result of a JSX expression is typed as `any`. You can customize the type by specifying the `JSX.Element` interface. However, it is not possible to retrieve type information about the element, attributes or children of the JSX from this interface. It is a black box. +By default the result of a JSX expression is typed as `any`. +You can customize the type by specifying the `JSX.Element` interface. +However, it is not possible to retrieve type information about the element, attributes or children of the JSX from this interface. +It is a black box. # Escaping to TypeScript -JSX in JavaScript allows you to escape to JavaScript by using curly braces `{ }`. JSX in TypeScript allows you to do the same thing, but you escape to TypeScript. That means transpilation features and type checking still work when embedded within JSX. +JSX in JavaScript allows you to escape to JavaScript by using curly braces `{ }`. +JSX in TypeScript allows you to do the same thing, but you escape to TypeScript. +That means transpilation features and type checking still work when embedded within JSX. -```jsx +```JSX var a =
{['foo', 'bar'].map(i => {i/2})}
``` -The above code will result in an error since you cannot divide a string by a number. The output, when using the `preserve` option, looks like: +The above code will result in an error since you cannot divide a string by a number. +The output, when using the `preserve` option, looks like: -```jsx +```JSX var a =
{['foo', 'bar'].map(function (i) { return {i / 2}; })}
@@ -244,9 +271,10 @@ var a =
# React integration -To use JSX with React you should use the [React typings](https://github.com/borisyankov/DefinitelyTyped/tree/master/react). These typings define the `JSX` namespace appropriately for use with React. +To use JSX with React you should use the [React typings](https://github.com/borisyankov/DefinitelyTyped/tree/master/react). +These typings define the `JSX` namespace appropriately for use with React. -```typescript +```TypeScript /// interface Props { From 2d11e7f39d53b1144c35e4513b8f9c5b45ab42fe Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 11 Aug 2015 18:03:23 -0700 Subject: [PATCH 0015/1736] Fix table. --- JSX.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JSX.md b/JSX.md index bd923f07..06e0578c 100644 --- a/JSX.md +++ b/JSX.md @@ -22,7 +22,7 @@ Additionally the output will have a `.jsx` file extension. The `react` mode will emit `React.createElement`, does not need to go through a JSX transformation before use, and the output will have a `.js` file extension. Mode | Input | Output | File Extension -====================================================================== +-----------|-----------|------------------------------|--------------- `preserve` | `
` | `
` | `.jsx` `react` | `
` | `React.createElement("div")` | `.js` From ee998ca20e55fa2bfa759487db9e23a9cc686c9c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 11 Aug 2015 18:04:21 -0700 Subject: [PATCH 0016/1736] difference --- JSX.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JSX.md b/JSX.md index 06e0578c..722e8d31 100644 --- a/JSX.md +++ b/JSX.md @@ -54,7 +54,7 @@ The `as` operator is available in both `.ts` and `.tsx` files. # Type Checking -In order to understand type checking with JSX you must first understand the differnece between intrinsic elements value-based elements. +In order to understand type checking with JSX you must first understand the difference between intrinsic elements value-based elements. Given a JSX expression ``, `expr` may either refer to something intrinsic to the environment (e.g. a `div` or `span` in a DOM environment) or to a custom component that you've created. This is important for two reasons: From 6ed22fe1bc5b38a145af8e30f8bb133b1ccb371a Mon Sep 17 00:00:00 2001 From: James Brantly Date: Wed, 12 Aug 2015 20:13:47 -0400 Subject: [PATCH 0017/1736] Fix header --- Modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules.md b/Modules.md index 72746d6e..8bfcff3b 100644 --- a/Modules.md +++ b/Modules.md @@ -339,7 +339,7 @@ var sq = new polygons.Square(); // Same as 'new Shapes.Polygons.Square()' Notice that we don't use the _require_ keyword; instead we assign directly from the qualified name of the symbol we're importing. This is similar to using _var_, but also works on the type and namespace meanings of the imported symbol. Importantly, for values, _import_ is a distinct reference from the original symbol, so changes to an aliased _var_ will not be reflected in the original variable. -! Optional Module Loading and Other Advanced Loading Scenarios +# Optional Module Loading and Other Advanced Loading Scenarios In some cases, you may want to only load a module under some conditions. In TypeScript, we can use the pattern shown below to implement this and other advanced loading scenarios to directly invoke the module loaders without losing type safety. The compiler detects whether each module is used in the emitted JavaScript. For modules that are only used as part of the type system, no require calls are emitted. This culling of unused references is a good performance optimization, and also allows for optional loading of those modules. From 2a21c2141d3013ea3100157cea22a6f96b887dc2 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 13 Aug 2015 01:30:10 -0700 Subject: [PATCH 0018/1736] Updated Roadmap (markdown) --- Roadmap.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Roadmap.md b/Roadmap.md index ffa7528c..f7ddbf5d 100644 --- a/Roadmap.md +++ b/Roadmap.md @@ -19,6 +19,7 @@ * [Intersection types](https://github.com/Microsoft/TypeScript/pull/3622) * [`abstract` classes and methods](https://github.com/Microsoft/TypeScript/issues/3578) * [Strict object literal assignment checking](https://github.com/Microsoft/TypeScript/pull/3823) +* [Declaration merging for classes and interfaces](https://github.com/Microsoft/TypeScript/pull/3333) # 1.5 From 2a4677e2c262ff9c4a8ffd2e2459e70f0e956dc6 Mon Sep 17 00:00:00 2001 From: Dan Slaubaugh Date: Thu, 20 Aug 2015 10:07:59 -0500 Subject: [PATCH 0019/1736] Removing comment on fixed function A comment was left behind on a fixed example of how to use generics for parameter constraints. --- Generics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Generics.md b/Generics.md index 54d8112c..b3830ee2 100644 --- a/Generics.md +++ b/Generics.md @@ -246,7 +246,7 @@ find (giraffe, myAnimals); You can achieve the pattern above by replacing the type parameter with its constraint. Rewriting the example above, ```TypeScript -function find(n: T, s: Findable) { // errors because type parameter used in constraint +function find(n: T, s: Findable) { // ... } find(giraffe, myAnimals); From 53d759f5cb4344b1da7e751852852011bcd3b54a Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Sun, 23 Aug 2015 12:47:07 -0700 Subject: [PATCH 0020/1736] Document new msbuild properties for 1.6 --- ...ng-Compiler-Options-in-MSBuild-projects.md | 66 ++++++++++--------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/Setting-Compiler-Options-in-MSBuild-projects.md b/Setting-Compiler-Options-in-MSBuild-projects.md index 784f6b63..f9492c11 100644 --- a/Setting-Compiler-Options-in-MSBuild-projects.md +++ b/Setting-Compiler-Options-in-MSBuild-projects.md @@ -19,35 +19,39 @@ Compiler options can be specified using MSBuild properties within an MSBuild pro Compiler Option | MSBuild Property Name | Allowed Values ------------------|-----------------------|----------------- ---declaration | TypeScriptGeneratesDeclarations | boolean ---module | TypeScriptModuleKind | AMD, CommonJs, UMD, or System ---target | TypeScriptTarget | ES3, ES5, or ES6 ---charset | TypeScriptCharset | ---emitBOM | TypeScriptEmitBOM | boolean ---emitDecoratorMetadata | TypeScriptEmitDecoratorMetadata | boolean ---experimentalDecorators | TypeScriptExperimentalDecorators | boolean ---inlineSourceMap | TypeScriptInlineSourceMap | boolean ---inlineSources | TypeScriptInlineSources| boolean ---locale | Automatically set to PreferredUILang value | ---mapRoot | TypeScriptMapRoot | File path ---newLine | TypeScriptNewLine | CRLF or LF ---noEmitOnError | TypeScriptNoEmitOnError | boolean ---noEmitHelpers | TypeScriptNoEmitHelpers | boolean ---noImplicitAny | TypeScriptNoImplicitAny | boolean ---noLib | TypeScriptNoLib | boolean ---noResolve | TypeScriptNoResolve | boolean ---out | TypeScriptOutFile | File path ---outDir | TypeScriptOutDir | File path ---preserveConstEnums | TypeScriptPreserveConstEnums | boolean ---removeComments | TypeScriptRemoveComments | boolean ---rootDir | TypeScriptRootDir | File path ---separateCompilation | TypeScriptSingleFile | boolean ---sourceMap | TypeScriptSourceMap | File path ---sourceRoot | TypeScriptSourceRoot | File path ---suppressImplicitAnyIndexErrors | TypeScriptSuppressImplicitAnyIndexErrors | boolean ---project | *Not supported in VS* | ---watch | *Not supported in VS* | ---diagnostics | *Not supported in VS* | ---listFiles | *Not supported in VS* | ---noEmit | *Not supported in VS* | +`--declaration` | TypeScriptGeneratesDeclarations | boolean +`--module` | TypeScriptModuleKind | AMD, CommonJs, UMD, or System +`--target` | TypeScriptTarget | ES3, ES5, or ES6 +`--charset` | TypeScriptCharset | +`--emitBOM` | TypeScriptEmitBOM | boolean +`--emitDecoratorMetadata` | TypeScriptEmitDecoratorMetadata | boolean +`--experimentalDecorators` | TypeScriptExperimentalDecorators | boolean +`--inlineSourceMap` | TypeScriptInlineSourceMap | boolean +`--inlineSources` | TypeScriptInlineSources| boolean +`--locale` | Automatically set to PreferredUILang value | +`--mapRoot` | TypeScriptMapRoot | File path +`--newLine` | TypeScriptNewLine | CRLF or LF +`--noEmitOnError` | TypeScriptNoEmitOnError | boolean +`--noEmitHelpers` | TypeScriptNoEmitHelpers | boolean +`--noImplicitAny` | TypeScriptNoImplicitAny | boolean +`--noLib` | TypeScriptNoLib | boolean +`--noResolve` | TypeScriptNoResolve | boolean +`--out` | TypeScriptOutFile | File path +`--outDir` | TypeScriptOutDir | File path +`--preserveConstEnums` | TypeScriptPreserveConstEnums | boolean +`--removeComments` | TypeScriptRemoveComments | boolean +`--rootDir` | TypeScriptRootDir | File path +`--separateCompilation` | TypeScriptSingleFile | boolean +`--sourceMap` | TypeScriptSourceMap | File path +`--sourceRoot` | TypeScriptSourceRoot | File path +`--suppressImplicitAnyIndexErrors` | TypeScriptSuppressImplicitAnyIndexErrors | boolean +`--project` | *Not supported in VS* | +`--watch` | *Not supported in VS* | +`--diagnostics` | *Not supported in VS* | +`--listFiles` | *Not supported in VS* | +`--noEmit` | *Not supported in VS* | *VS only option* | TypeScriptAdditionalFlags | *Any compiler option* +`--moduleResolution` [1]| TypeScriptModuleResolution | Classic, or NodeJs +`--experimentalAsyncFunctions` [1]| TypeScriptExperimentalAsyncFunctions | boolean + +1 These settings are new in TypeScript 1.6 From cee65b84640917b66d4ac9e722cb7b9af010af40 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 24 Aug 2015 13:32:50 -0700 Subject: [PATCH 0021/1736] Remove notes about options being 1.5-specific in 'Compiler Options'. --- Compiler-Options.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Compiler-Options.md b/Compiler-Options.md index e3f2167a..f81993b7 100644 --- a/Compiler-Options.md +++ b/Compiler-Options.md @@ -4,21 +4,21 @@ Option | Shorthand | Description `--declaration` | `--d` | Generates corresponding '.d.ts' file. `--help` | `--h` | Print help message. `--version` | `--v` | Print the compiler's version. -`--module` | `--m` | Specify module code generation: 'commonjs', 'amd', 'system'[2], or 'umd'[2]. +`--module` | `--m` | Specify module code generation: 'commonjs', 'amd', 'system', or 'umd'. `--project` | `--p` | Compile the project in the given directory. The directory needs to contain a `tsconfig.json` file to direct compilation. See [[tsconfig.json]] documentation for more details. `--target` | `--t` | Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6'[1] `--watch` | `--w` | Run the compiler in watch mode. Watch input files and trigger recompilation on changes. `--charset` | | The character set of the input files. `--diagnostics` | | Show diagnostic information. `--emitBOM` | | Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. -`--emitDecoratorMetadata`[1][2] | | Emit design-type metadata for decorated declarations in source. See [issue #2577](https://github.com/Microsoft/TypeScript/issues/2577) for details. -`--inlineSourceMap`[2] | | Emit a single file with source maps instead of having a separate file. -`--inlineSources`[2] | | Emit the source alongside the sourcemaps within a single file; requires `--inlineSourceMap` to be set. -`--isolatedModules`[2] | | Unconditionally emit imports for unresolved files. +`--emitDecoratorMetadata`[1] | | Emit design-type metadata for decorated declarations in source. See [issue #2577](https://github.com/Microsoft/TypeScript/issues/2577) for details. +`--inlineSourceMap` | | Emit a single file with source maps instead of having a separate file. +`--inlineSources` | | Emit the source alongside the sourcemaps within a single file; requires `--inlineSourceMap` to be set. +`--isolatedModules` | | Unconditionally emit imports for unresolved files. `--listFiles` | | Print names of files part of the compilation. `--locale` | | The locale to use to show error messages, e.g. en-us. `--mapRoot` | | Specifies the location where debugger should locate map files instead of generated locations. Use this flag if the .map files will be located at run-time in a different location than than the .js files. The location specified will be embedded in the sourceMap to direct the debugger where the map files where be located. -`--newLine`[2] | | Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." +`--newLine` | | Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." `--noEmit` | | Do not emit outputs. `--noEmitOnError` | | Do not emit outputs if any type checking errors were reported. `--noEmitHelpers` | | Do not generate custom helper functions like `__extends` in compiled output. @@ -29,7 +29,7 @@ Option | Shorthand | Description `--outDir` | | Redirect output structure to the directory. `--preserveConstEnums` | | Do not erase const enum declarations in generated code. See [const enums documentation](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#94-constant-enum-declarations) for more details. `--removeComments` | | Do not emit comments to output. -`--rootDir`[2] | | Specifies the root directory of input files. Use to control the output directory structure with `--outDir`. +`--rootDir` | | Specifies the root directory of input files. Use to control the output directory structure with `--outDir`. `--sourceMap` | | Generates corresponding '.map' file. `--sourceRoot` | | Specifies the location where debugger should locate TypeScript files instead of source locations. Use this flag if the sources will be located at run-time in a different location than that at design-time. The location specified will be embedded in the sourceMap to direct the debugger where the source files where be located. `--stripInternal`[1] | | Do not emit declarations for code that has an `@internal` annotation. @@ -37,8 +37,6 @@ Option | Shorthand | Description [1] These options are experimental. -[2] These options will only be available in TypeScript 1.5. - ## Related - For tsconfig.json see [[tsconfig.json]] - For Setting the compiler options in MSBuild projects see [[Setting Compiler Options in MSBuild projects]] From bd933b7693963037fd65e7291555a4702a67f996 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 24 Aug 2015 13:35:15 -0700 Subject: [PATCH 0022/1736] Move order of MSBuild options --- Setting-Compiler-Options-in-MSBuild-projects.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Setting-Compiler-Options-in-MSBuild-projects.md b/Setting-Compiler-Options-in-MSBuild-projects.md index f9492c11..03a59a0a 100644 --- a/Setting-Compiler-Options-in-MSBuild-projects.md +++ b/Setting-Compiler-Options-in-MSBuild-projects.md @@ -20,8 +20,8 @@ Compiler options can be specified using MSBuild properties within an MSBuild pro Compiler Option | MSBuild Property Name | Allowed Values ------------------|-----------------------|----------------- `--declaration` | TypeScriptGeneratesDeclarations | boolean -`--module` | TypeScriptModuleKind | AMD, CommonJs, UMD, or System -`--target` | TypeScriptTarget | ES3, ES5, or ES6 +`--module` | TypeScriptModuleKind | `AMD`, `CommonJs`, `UMD`, or `System` +`--target` | TypeScriptTarget | `ES3`, `ES5`, or `ES6` `--charset` | TypeScriptCharset | `--emitBOM` | TypeScriptEmitBOM | boolean `--emitDecoratorMetadata` | TypeScriptEmitDecoratorMetadata | boolean @@ -30,7 +30,7 @@ Compiler Option | MSBuild Property Name | Allowed Values `--inlineSources` | TypeScriptInlineSources| boolean `--locale` | Automatically set to PreferredUILang value | `--mapRoot` | TypeScriptMapRoot | File path -`--newLine` | TypeScriptNewLine | CRLF or LF +`--newLine` | TypeScriptNewLine | `CRLF` or `LF` `--noEmitOnError` | TypeScriptNoEmitOnError | boolean `--noEmitHelpers` | TypeScriptNoEmitHelpers | boolean `--noImplicitAny` | TypeScriptNoImplicitAny | boolean @@ -45,13 +45,13 @@ Compiler Option | MSBuild Property Name | Allowed Values `--sourceMap` | TypeScriptSourceMap | File path `--sourceRoot` | TypeScriptSourceRoot | File path `--suppressImplicitAnyIndexErrors` | TypeScriptSuppressImplicitAnyIndexErrors | boolean +`--moduleResolution`[1] | TypeScriptModuleResolution | `Classic` or `NodeJs` +`--experimentalAsyncFunctions`[1] | TypeScriptExperimentalAsyncFunctions | boolean `--project` | *Not supported in VS* | `--watch` | *Not supported in VS* | `--diagnostics` | *Not supported in VS* | `--listFiles` | *Not supported in VS* | `--noEmit` | *Not supported in VS* | *VS only option* | TypeScriptAdditionalFlags | *Any compiler option* -`--moduleResolution` [1]| TypeScriptModuleResolution | Classic, or NodeJs -`--experimentalAsyncFunctions` [1]| TypeScriptExperimentalAsyncFunctions | boolean 1 These settings are new in TypeScript 1.6 From cfc8381529001a08209753a7f31465eeff04a548 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 25 Aug 2015 17:16:31 -0700 Subject: [PATCH 0023/1736] Add new compiler options for 1.6. --- Compiler-Options.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Compiler-Options.md b/Compiler-Options.md index f81993b7..1716cfb1 100644 --- a/Compiler-Options.md +++ b/Compiler-Options.md @@ -12,12 +12,15 @@ Option | Shorthand | Description `--diagnostics` | | Show diagnostic information. `--emitBOM` | | Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. `--emitDecoratorMetadata`[1] | | Emit design-type metadata for decorated declarations in source. See [issue #2577](https://github.com/Microsoft/TypeScript/issues/2577) for details. +`--experimentalAsyncFunctions` | | Support ES7-proposed asynchronous functions using the `async`/`await` keywords. `--inlineSourceMap` | | Emit a single file with source maps instead of having a separate file. `--inlineSources` | | Emit the source alongside the sourcemaps within a single file; requires `--inlineSourceMap` to be set. `--isolatedModules` | | Unconditionally emit imports for unresolved files. +`--jsx` | | Support JSX in '.tsx' files: 'React' or 'Preserve'. See [[JSX]]. `--listFiles` | | Print names of files part of the compilation. `--locale` | | The locale to use to show error messages, e.g. en-us. `--mapRoot` | | Specifies the location where debugger should locate map files instead of generated locations. Use this flag if the .map files will be located at run-time in a different location than than the .js files. The location specified will be embedded in the sourceMap to direct the debugger where the map files where be located. +`--moduleResolution`[1] | | Determine how modules get resolved. Either 'node' for Node.js/io.js style resolution, or 'classic' (default). `--newLine` | | Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." `--noEmit` | | Do not emit outputs. `--noEmitOnError` | | Do not emit outputs if any type checking errors were reported. @@ -25,8 +28,9 @@ Option | Shorthand | Description `--noImplicitAny` | | Raise error on expressions and declarations with an implied 'any' type. `--noLib` | | Do not include the default library file (lib.d.ts). `--noResolve` | | Do not add triple-slash references or module import targets to the list of compiled files. -`--out` | | Concatenate and emit output to single file. The order of concatenation is determined by the list of files passed to the compiler on the command line along with triple-slash references and imports. See output file order documentation for more details. +`--out` | | DEPRECATED. Use `--outFile` instead. `--outDir` | | Redirect output structure to the directory. +`--outFile` | | Concatenate and emit output to single file. The order of concatenation is determined by the list of files passed to the compiler on the command line along with triple-slash references and imports. See output file order documentation for more details. `--preserveConstEnums` | | Do not erase const enum declarations in generated code. See [const enums documentation](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#94-constant-enum-declarations) for more details. `--removeComments` | | Do not emit comments to output. `--rootDir` | | Specifies the root directory of input files. Use to control the output directory structure with `--outDir`. From e133ffa8c7f26be9694cf1555ce11b2f313f9b64 Mon Sep 17 00:00:00 2001 From: Jason Ramsay Date: Wed, 26 Aug 2015 11:10:39 -0700 Subject: [PATCH 0024/1736] Updates to tsconfig.json for the new 'excludes' property --- tsconfig.json.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/tsconfig.json.md b/tsconfig.json.md index da5ec594..8407693a 100644 --- a/tsconfig.json.md +++ b/tsconfig.json.md @@ -7,8 +7,10 @@ The presence of a `tsconfig.json` file in a directory indicates that the directo When input files are specified on the command line, `tsconfig.json` files are ignored. -## Example -An example `tsconfig.json` file: +## Examples +Example `tsconfig.json` files: + +* Using the `"files"` property ```json { "compilerOptions": { @@ -37,11 +39,35 @@ An example `tsconfig.json` file: } ``` +* Using the `"exclude"` property +```json +{ + "compilerOptions": { + "module": "commonjs", + "noImplicitAny": true, + "removeComments": true, + "preserveConstEnums": true, + "out": "../../built/local/tsc.js", + "sourceMap": true + }, + "exclude": [ + "node_modules", + "wwwroot" + ] +} +``` + ## Details The `"compilerOptions"` property can be omitted, in which case the compiler's defaults are used. For more details about supported compiler options see [[Compiler Options]] documentation. If no `"files"` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories. When a `"files"` property is specified, only those files are included. +If the `"exclude"` property is specified, the compiler includes all files in the containing directory and subdirectories except for those files that are excluded. + +The `"files"` property cannot be used in conjunction with the `"exclude"` property. If both are specified then the `"files"` property takes precedence. + +Files referenced by files that are included are also included. Similarly, if a file is referenced by another file it cannot be excluded unless the referencing file is also excluded. + A `tsconfig.json` file is permitted to be completely empty, which compiles all files in the containing directory and subdirectories with the default compiler options. Compiler options specified on the command line override those specified in the `tsconfig.json` file. From 8c3440feaee4527e388100aca7d59cff2bdd15a3 Mon Sep 17 00:00:00 2001 From: Jason Ramsay Date: Wed, 26 Aug 2015 13:15:27 -0700 Subject: [PATCH 0025/1736] Updating awkward wording in tsconfig details section --- tsconfig.json.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json.md b/tsconfig.json.md index 8407693a..563ffe0d 100644 --- a/tsconfig.json.md +++ b/tsconfig.json.md @@ -66,7 +66,7 @@ If the `"exclude"` property is specified, the compiler includes all files in the The `"files"` property cannot be used in conjunction with the `"exclude"` property. If both are specified then the `"files"` property takes precedence. -Files referenced by files that are included are also included. Similarly, if a file is referenced by another file it cannot be excluded unless the referencing file is also excluded. +Any files that are referenced by those specified in the `"files"` property are also included. Similarly, if a file B.ts is referenced by another file A.ts, then B.ts cannot be excluded unless the referencing file A.ts is also excluded. A `tsconfig.json` file is permitted to be completely empty, which compiles all files in the containing directory and subdirectories with the default compiler options. From b8f728dca64db9ac56d55a7d2cda731e652ec3d2 Mon Sep 17 00:00:00 2001 From: Jason Ramsay Date: Thu, 27 Aug 2015 17:48:37 -0700 Subject: [PATCH 0026/1736] Rewording exclude list based on CR feedback --- tsconfig.json.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json.md b/tsconfig.json.md index 563ffe0d..19257f76 100644 --- a/tsconfig.json.md +++ b/tsconfig.json.md @@ -66,7 +66,7 @@ If the `"exclude"` property is specified, the compiler includes all files in the The `"files"` property cannot be used in conjunction with the `"exclude"` property. If both are specified then the `"files"` property takes precedence. -Any files that are referenced by those specified in the `"files"` property are also included. Similarly, if a file B.ts is referenced by another file A.ts, then B.ts cannot be excluded unless the referencing file A.ts is also excluded. +Any files that are referenced by those specified in the `"files"` property are also included. Similarly, if a file B.ts is referenced by another file A.ts, then B.ts cannot be excluded unless the referencing file A.ts is also specified in the `"exclude"` list. A `tsconfig.json` file is permitted to be completely empty, which compiles all files in the containing directory and subdirectories with the default compiler options. From 41a26a2242bd713c0245b0f193e0633f776ca313 Mon Sep 17 00:00:00 2001 From: clownwilleatme Date: Fri, 28 Aug 2015 15:19:30 +1000 Subject: [PATCH 0027/1736] Updated registry information to include lib.d.ts Updated the information about the registry settings for specifying the lib.d.ts library definition to use in conjunction with a custom language service file. --- Dev-Mode-in-Visual-Studio.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dev-Mode-in-Visual-Studio.md b/Dev-Mode-in-Visual-Studio.md index 0f88668f..e7364960 100644 --- a/Dev-Mode-in-Visual-Studio.md +++ b/Dev-Mode-in-Visual-Studio.md @@ -27,6 +27,10 @@ Note: You may also use the [VSDevMode.ps1](https://github.com/Microsoft/TypeScri 4. Right click the `CustomTypeScriptServicesFileLocation` value and **Modify** it. 5. Change the value data to the full path of your alternative services file (e.g. `C:\Users\Daniel\TypeScript\built\local\typescriptServices.js`) +To use a custom lib.d.ts library definition in conjunction with the custom language service file, there are two additional registery keys which need to be set. Both reside in the `TypeScriptLanguageService` key as specified above: +* `CustomDefaultLibraryLocation` - for lib.d.ts (e.g. `C:\Users\Daniel\TypeScript\built\local\lib.d.ts`) +* `CustomDefaultES6LibraryLocation` - for lib.es6.d.ts (e.g. `C:\Users\Daniel\TypeScript\built\local\lib.es6.d.ts`) + # Hot swapping When the language service's script side is modified in any way (whether or not you are using a custom location for your language service file), it will be reloaded on the fly for a given thread the next time any of that thread's services are requested. However, this means that if debugging, your language service threads will be purged. @@ -57,4 +61,4 @@ At this point you should be able to hit debug points and get an understanding of * **LanguageService_N** and **LanguageService_N**: Unfortunately these haven't been distinctly named. * One of these is the syntactic classifier, giving accurate (semantically agnostic) classifications. * The other performs all syntax-related questions such as formatting, smart indentation, etc. -* **CoreServices_N**: This is used to perform semantic operations such as providing diagnostics, completion lists, quick info, etc. Effectively, anything that needs the typechecker will use this thread. \ No newline at end of file +* **CoreServices_N**: This is used to perform semantic operations such as providing diagnostics, completion lists, quick info, etc. Effectively, anything that needs the typechecker will use this thread. From 546bd5569eb460a7e5052ff257e3701565b327d4 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 28 Aug 2015 12:52:44 -0700 Subject: [PATCH 0028/1736] Updated Roadmap (markdown) --- Roadmap.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Roadmap.md b/Roadmap.md index f7ddbf5d..4dec29e2 100644 --- a/Roadmap.md +++ b/Roadmap.md @@ -20,6 +20,7 @@ * [`abstract` classes and methods](https://github.com/Microsoft/TypeScript/issues/3578) * [Strict object literal assignment checking](https://github.com/Microsoft/TypeScript/pull/3823) * [Declaration merging for classes and interfaces](https://github.com/Microsoft/TypeScript/pull/3333) +* New [--init](https://github.com/Microsoft/TypeScript/issues/3079) # 1.5 From af51ef5a09dbc0636bf3a7ecf84c8e3d639952ab Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 28 Aug 2015 13:01:04 -0700 Subject: [PATCH 0029/1736] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index 27cde053..b3834878 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -109,6 +109,12 @@ export default Foo; For more details see [the originating issue](https://github.com/Microsoft/TypeScript/issues/3095). +#### Changes to DOM API's in the standard library + +* **MessageEvent** and **ProgressEvent** constructors now expect arguments; see [issue #4295](https://github.com/Microsoft/TypeScript/issues/4295) for more details. +* **ImageData** constructor now expects arguments; see [issue #4220](https://github.com/Microsoft/TypeScript/issues/4220) for more details. +* **File** constructor now expects arguments; see [issue #3999](https://github.com/Microsoft/TypeScript/issues/3999) for more details. + # TypeScript 1.5 For full list of breaking changes see the [breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+milestone%3A%22TypeScript+1.5%22+label%3A%22breaking+change%22). From e368701c8b1d7c7b2b5ff31d18ac8ac1421d8329 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 28 Aug 2015 13:05:40 -0700 Subject: [PATCH 0030/1736] Updated Breaking Changes (markdown) --- Breaking-Changes.md | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Breaking-Changes.md b/Breaking-Changes.md index b3834878..b498a560 100644 --- a/Breaking-Changes.md +++ b/Breaking-Changes.md @@ -6,20 +6,6 @@ These changes list where implementation differs between versions as the spec and For full list of breaking changes see the [breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+milestone%3A%22TypeScript+1.6%22+label%3A%22breaking+change%22). -#### .js content of npm package is moved from 'bin' to 'lib' folder - -Entry point of TypeScript npm package was moved from `bin` to `lib` to unblock scenarios when 'node_modules/typescript/bin/typescript.js' is served from IIS (by default `bin` is in the list of hidden segments so IIS will block access to this folder). - -#### Module body is parsed in strict mode - -In accordance with [the ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-strict-mode-code), module bodies are now parsed in strict mode. module bodies will behave as if `"use strict"` was defined at the top of their scope; this includes flagging the use of `arguments` and `eval` as variable or parameter names, use of future reserved words as variables or parameters, use of octal numeric literals, etc.. - -#### System module output uses bulk exports - -The compiler uses the [new bulk-export](https://github.com/ModuleLoader/es6-module-loader/issues/386) variation of the `_export` function in the System module format that takes any object containing key value pairs (optionally an entire module object for export *) as arguments instead of key, value. - -The module loader needs to be updated to [v0.17.1](https://github.com/ModuleLoader/es6-module-loader/releases/tag/v0.17.1) or higher. - #### Strict object literal assignment checking It is an error to specify properties in an object literal that were not specified on the target type, when assigned to a variable or passed for a parameter of a non-empty target type. @@ -109,12 +95,30 @@ export default Foo; For more details see [the originating issue](https://github.com/Microsoft/TypeScript/issues/3095). +#### Module body is parsed in strict mode + +In accordance with [the ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-strict-mode-code), module bodies are now parsed in strict mode. module bodies will behave as if `"use strict"` was defined at the top of their scope; this includes flagging the use of `arguments` and `eval` as variable or parameter names, use of future reserved words as variables or parameters, use of octal numeric literals, etc.. + #### Changes to DOM API's in the standard library * **MessageEvent** and **ProgressEvent** constructors now expect arguments; see [issue #4295](https://github.com/Microsoft/TypeScript/issues/4295) for more details. * **ImageData** constructor now expects arguments; see [issue #4220](https://github.com/Microsoft/TypeScript/issues/4220) for more details. * **File** constructor now expects arguments; see [issue #3999](https://github.com/Microsoft/TypeScript/issues/3999) for more details. +#### System module output uses bulk exports + +The compiler uses the [new bulk-export](https://github.com/ModuleLoader/es6-module-loader/issues/386) variation of the `_export` function in the System module format that takes any object containing key value pairs (optionally an entire module object for export *) as arguments instead of key, value. + +The module loader needs to be updated to [v0.17.1](https://github.com/ModuleLoader/es6-module-loader/releases/tag/v0.17.1) or higher. + +#### .js content of npm package is moved from 'bin' to 'lib' folder + +Entry point of TypeScript npm package was moved from `bin` to `lib` to unblock scenarios when 'node_modules/typescript/bin/typescript.js' is served from IIS (by default `bin` is in the list of hidden segments so IIS will block access to this folder). + +#### TypeScript npm package does not install globally by default + +TypeScript 1.6 removes the `preferGlobal` flag from package.json. If you relay on this behaviour please use `npm install -g typescript`. + # TypeScript 1.5 For full list of breaking changes see the [breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+milestone%3A%22TypeScript+1.5%22+label%3A%22breaking+change%22). From f60888ccf9a2173bab6c6a8c87988ff768924122 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 28 Aug 2015 19:10:25 -0700 Subject: [PATCH 0031/1736] Simplify a sentence The word "when" was used twice very closely together, making the sentence slightly awkward to read. --- Functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Functions.md b/Functions.md index cedd2e4c..7173e2b0 100644 --- a/Functions.md +++ b/Functions.md @@ -170,7 +170,7 @@ var buildNameFun: (fname: string, ...rest: string[])=>string = buildName; How 'this' works in JavaScript functions is a common theme in programmers coming to JavaScript. Indeed, learning how to use it is something of a rite of passage as developers become more accustomed to working in JavaScript. Since TypeScript is a superset of JavaScript, TypeScript developers also need to learn how to use 'this' and how to spot when it's not being used correctly. A whole article could be written on how to use 'this' in JavaScript, and many have. Here, we'll focus on some of the basics. -In JavaScript, 'this' is a variable that's set when a function is called. This makes it a very powerful and flexible feature, but it comes at the cost of always having to know about the context that a function is executing in. This can be notoriously confusing, when, for example, when a function is used as a callback. +In JavaScript, 'this' is a variable that's set when a function is called. This makes it a very powerful and flexible feature, but it comes at the cost of always having to know about the context that a function is executing in. This can be notoriously confusing, when, for example, a function is used as a callback. Let's look at an example: From 8ddf849f56efc078330f5267fe37565a8fe07036 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 28 Aug 2015 19:18:01 -0700 Subject: [PATCH 0032/1736] Grammar fix "we switching" -> "we switch" --- Functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Functions.md b/Functions.md index cedd2e4c..4b335712 100644 --- a/Functions.md +++ b/Functions.md @@ -198,7 +198,7 @@ If we tried to run the example, we would get an error instead of the expected al We can fix this by making sure the function is bound to the correct 'this' before we return the function to be used later. This way, regardless of how its later used, it will still be able to see the original 'deck' object. -To fix this, we switching the function expression to use the lambda syntax ( ()=>{} ) rather than the JavaScript function expression. This will automatically capture the 'this' available when the function is created rather than when it is invoked: +To fix this, we switch the function expression to use the lambda syntax ( ()=>{} ) rather than the JavaScript function expression. This will automatically capture the 'this' available when the function is created rather than when it is invoked: ```TypeScript var deck = { From efb22f206047ad23efca4ee93099519160c4e403 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 29 Aug 2015 14:16:11 -0700 Subject: [PATCH 0033/1736] Added a notice to the top of all handbook pages. --- Basic-Types.md | 3 +++ Classes.md | 3 +++ Declaration-Merging.md | 3 +++ Functions.md | 3 +++ Generics.md | 3 +++ Interfaces.md | 3 +++ Mixins.md | 3 +++ Modules.md | 3 +++ Type-Compatibility.md | 3 +++ Type-Inference.md | 3 +++ Writing-Definition-Files.md | 3 +++ 11 files changed, 33 insertions(+) diff --git a/Basic-Types.md b/Basic-Types.md index 26fa1f43..d06e410e 100644 --- a/Basic-Types.md +++ b/Basic-Types.md @@ -1,3 +1,6 @@ +> # Hey, this page is out of date! +> For a more up to date guide, check out [Basic Types](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Basic%20Types.md) at our Handbook repo page. + # 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. In TypeScript, we support much the same types as you would expected in JavaScript, with a convenient enumeration type thrown in to help things along. diff --git a/Classes.md b/Classes.md index 281ce87a..bb7c4554 100644 --- a/Classes.md +++ b/Classes.md @@ -1,3 +1,6 @@ +> # Hey, this page is out of date! +> For a more up to date guide, check out [Classes](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Classes.md) at our Handbook repo page. + # Introduction Traditional JavaScript focuses on functions and prototype-based inheritance as the basic means of building up reusable components, but this may feel a bit awkward to programmers more comfortable with an object-oriented approach, where classes inherit functionality and objects are built from these classes. Starting with ECMAScript 6, the next version of JavaScript, JavaScript programmers will be able to build their applications using this object-oriented class-based approach. In TypeScript, we allow developers to use these techniques now, and compile them down to JavaScript that works across all major browsers and platforms, without having to wait for the next version of JavaScript. diff --git a/Declaration-Merging.md b/Declaration-Merging.md index a506bfd9..78ad7f3e 100644 --- a/Declaration-Merging.md +++ b/Declaration-Merging.md @@ -1,3 +1,6 @@ +> # Hey, this page is out of date! +> For a more up to date guide, check out [Declaration Merging](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Declaration%20Merging.md) at our Handbook repo page. + # Introduction Some of the unique concepts in TypeScript comes from the necessity of describing what is happening to the shape of JavaScript objects at the type level. One example that is especially unique to TypeScript is the concept of 'declaration merging'. Understanding this concept will give you an advantage when working with existing JavaScript in your TypeScript. It also opens the door to more advanced abstraction concepts. diff --git a/Functions.md b/Functions.md index cedd2e4c..b92aa86a 100644 --- a/Functions.md +++ b/Functions.md @@ -1,3 +1,6 @@ +> # Hey, this page is out of date! +> For a more up to date guide, check out [Functions](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Functions.md) at our Handbook repo page. + # Introduction Functions are the fundamental building block of any applications in JavaScript. They're how you build up layers of abstraction, mimicking classes, information hiding, and modules. In TypeScript, while there are classes and modules, function still play the key role in describing how to 'do' things. TypeScript also adds some new capabilities to the standard JavaScript functions to make them easier to work with. diff --git a/Generics.md b/Generics.md index 54d8112c..7aead392 100644 --- a/Generics.md +++ b/Generics.md @@ -1,3 +1,6 @@ +> # Hey, this page is out of date! +> For a more up to date guide, check out [Generics](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Generics.md) at our Handbook repo page. + # Introduction A major part of software engineering is building components that not only have well-defined and consistent APIs, but are also reusable. Components that are capable of working on the data of today as well as the data of tomorrow will give you the most flexible capabilities for building up large software systems. diff --git a/Interfaces.md b/Interfaces.md index 93fd3b48..9dbcd299 100644 --- a/Interfaces.md +++ b/Interfaces.md @@ -1,3 +1,6 @@ +> # Hey, this page is out of date! +> For a more up to date guide, check out [Interfaces](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Interfaces.md) at our Handbook repo page. + # Introduction One of TypeScript's core principles is that type-checking focuses on the 'shape' that values have. This is sometimes called "duck typing" or "structural subtyping". In TypeScript, interfaces fill the role of naming these types, and are a powerful way of defining contracts within your code as well as contracts with code outside of your project. diff --git a/Mixins.md b/Mixins.md index 5ffd51ce..d75cbd28 100644 --- a/Mixins.md +++ b/Mixins.md @@ -1,3 +1,6 @@ +> # Hey, this page is out of date! +> For a more up to date guide, check out [Mixins](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Mixins.md) at our Handbook repo page. + # Introduction Along with traditional OO hierarchies, another popular way of building up classes from reusable components is to build them by combining simpler partial classes. You may be familiar with the idea of mixins or traits for languages like Scala, and the pattern has also reached some popularity in the JavaScript community. diff --git a/Modules.md b/Modules.md index 8bfcff3b..b5d47c72 100644 --- a/Modules.md +++ b/Modules.md @@ -1,3 +1,6 @@ +> # Hey, this page is out of date! +> For a more up to date guide, check out [Namespaces and Modules](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Namespaces%20and%20Modules.md) at our Handbook repo page. + # Introduction This post outlines the various ways to organize your code using modules in TypeScript. We'll be covering internal and external modules and we'll discuss when each is appropriate and how to use them. We'll also go over some advanced topics of how to use external modules, and address some common pitfalls when using modules in TypeScript. diff --git a/Type-Compatibility.md b/Type-Compatibility.md index 0564c5bf..7befb3e7 100644 --- a/Type-Compatibility.md +++ b/Type-Compatibility.md @@ -1,3 +1,6 @@ +> # Hey, this page is out of date! +> For a more up to date guide, check out [Type Compatibility](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Type%20Compatibility.md) at our Handbook repo page. + # Introduction Type compatibility in TypeScript is based on structural subtyping. Structural typing is a way of relating types based solely on their members. This is contrast with nominal typing. Consider the following code: diff --git a/Type-Inference.md b/Type-Inference.md index dcbf860d..67a53a88 100644 --- a/Type-Inference.md +++ b/Type-Inference.md @@ -1,3 +1,6 @@ +> # Hey, this page is out of date! +> For a more up to date guide, check out [Type Inference](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Type%20Inference.md) at our Handbook repo page. + # Introduction In this section, we will cover type inference in TypeScript. Namely, we'll discuss where and how types are inferred. diff --git a/Writing-Definition-Files.md b/Writing-Definition-Files.md index 04ec176f..4750e5e5 100644 --- a/Writing-Definition-Files.md +++ b/Writing-Definition-Files.md @@ -1,3 +1,6 @@ +> # Hey, this page is out of date! +> For a more up to date guide, check out [Writing Definition Files](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Writing%20Definition%20Files.md) at our Handbook repo page. + # Introduction When using an external JavaScript library, or new host API, you'll need to use a declaration file (.d.ts) to describe the shape of that library. This guide covers a few high-level concepts specific to writing definition files, then proceeds with a number of examples that show how to transcribe various concepts to their matching definition file descriptions. From b1456e2196bbcc1f9a4e082a083703643c47bf83 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 29 Aug 2015 15:47:24 -0700 Subject: [PATCH 0034/1736] Link to the Typescript-Handbook repo instead of the pages on this wiki. --- Home.md | 25 +++++++++++++------------ _Sidebar.md | 22 +++++++++++----------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Home.md b/Home.md index 03c589e7..4bdfc745 100644 --- a/Home.md +++ b/Home.md @@ -1,12 +1,12 @@ # Getting Started -* [Basic Types] (Basic Types) -* [Interfaces] (Interfaces) -* [Classes] (Classes) -* [Modules] (Modules) -* [Functions] (Functions) -* [Generics] (Generics) -* [Common Errors] (Common Errors) +* [Basic Types](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Basic%20Types.md) +* [Interfaces](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Interfaces.md) +* [Classes](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Classes.md) +* [Namespaces and Modules](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Namespaces%20and%20Modules.md) +* [Functions](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Functions.md) +* [Generics](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Generics.md) +* [Common Errors](Common Errors) * [[Integrating with Build Tools]] * [Compiler Options] (Compiler Options) * [TypeScript Editor Support](TypeScript-Editor-Support) @@ -15,9 +15,10 @@ # Advanced Topics -* [Mixins] (Mixins) -* [Declaration Merging] (Declaration Merging) -* [Type Inference] (Type Inference) -* [Type Compatibility] (Type Compatibility) -* [Writing Definition (.d.ts) Files] (Writing Definition Files) +* [Mixins](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Mixins.md) +* [Declaration Merging](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Declaration%20Merging.md) +* [Type Inference](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Type%20Inference.md) +* [Type Compatibility](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Type%20Compatibility.md) +* [Writing Definition (`.d.ts`) Files](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Writing%20Definition%20Files.md) +* [[JSX]] diff --git a/_Sidebar.md b/_Sidebar.md index 952da9a5..3ba2fd25 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -1,11 +1,11 @@ **TypeScript Language Basics** -* [[Basic Types]] -* [[Interfaces]] -* [[Classes]] -* [[Modules]] -* [[Functions]] -* [[Generics]] +* [Basic Types](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Basic%20Types.md) +* [Interfaces](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Interfaces.md) +* [Classes](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Classes.md) +* [Namespaces and Modules](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Namespaces%20and%20Modules.md) +* [Functions](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Functions.md) +* [Generics](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Generics.md) * [[Common Errors]] * [[Integrating with Build Tools]] * [[Compiler Options]] @@ -13,12 +13,12 @@ **TypeScript Language Advanced** -* [[Mixins]] -* [[Declaration Merging]] -* [[Type Inference]] -* [[Type Compatibility]] +* [Mixins](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Mixins.md) +* [Declaration Merging](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Declaration%20Merging.md) +* [Type Inference](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Type%20Inference.md) +* [Type Compatibility](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Type%20Compatibility.md) * [[JSX]] -* [[Writing Definition Files]] +* [Writing Definition Files](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Writing%20Definition%20Files.md) **News** * [[What's new in TypeScript]] From 8b9a42de12336618c7b44b9353dfa672cdad71cc Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 29 Aug 2015 15:47:51 -0700 Subject: [PATCH 0035/1736] Removed duplicated pages. --- Basic-Types.md | 107 -------- Classes.md | 303 ---------------------- Declaration-Merging.md | 203 --------------- Functions.md | 293 --------------------- Generics.md | 300 ---------------------- Interfaces.md | 285 --------------------- Mixins.md | 130 ---------- Modules.md | 498 ------------------------------------ Type-Compatibility.md | 234 ----------------- Type-Inference.md | 76 ------ Writing-Definition-Files.md | 220 ---------------- 11 files changed, 2649 deletions(-) delete mode 100644 Basic-Types.md delete mode 100644 Classes.md delete mode 100644 Declaration-Merging.md delete mode 100644 Functions.md delete mode 100644 Generics.md delete mode 100644 Interfaces.md delete mode 100644 Mixins.md delete mode 100644 Modules.md delete mode 100644 Type-Compatibility.md delete mode 100644 Type-Inference.md delete mode 100644 Writing-Definition-Files.md diff --git a/Basic-Types.md b/Basic-Types.md deleted file mode 100644 index d06e410e..00000000 --- a/Basic-Types.md +++ /dev/null @@ -1,107 +0,0 @@ -> # Hey, this page is out of date! -> For a more up to date guide, check out [Basic Types](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Basic%20Types.md) at our Handbook repo page. - -# 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. In TypeScript, we support much the same types as you would expected in JavaScript, with a convenient enumeration type thrown in to help things along. - -# Boolean - -The most basic datatype is the simple true/false value, which JavaScript and TypeScript (as well as other languages) call a 'boolean' value. - -```TypeScript -var isDone: boolean = false; -``` - -# Number - -As in JavaScript, all numbers in TypeScript are floating point values. These floating point numbers get the type 'number'. - -```TypeScript -var height: number = 6; -``` - -# String - -Another fundamental part of creating programs in JavaScript for webpages and servers alike is working with textual data. As in other languages, we use the type 'string' to refer to these textual datatypes. Just like JavaScript, TypeScript also uses the double quote (") or single quote (') to surround string data. - -```TypeScript -var name: string = "bob"; -name = 'smith'; -``` - -# Array - -TypeScript, like JavaScript, allows you to work with arrays of values. Array types can be written in one of two ways. In the first, you use the type of the elements followed by '[]' to denote an array of that element type: - -```TypeScript -var list:number[] = [1, 2, 3]; -``` - -The second way uses a generic array type, Array: - -```TypeScript -var list:Array = [1, 2, 3]; -``` - -# Enum - -A helpful addition to the standard set of datatypes from JavaScript is the 'enum'. Like languages like C#, an enum is a way of giving more friendly names to sets of numeric values. - -```TypeScript -enum Color {Red, Green, Blue} -var c: Color = Color.Green; -``` - -By default, enums begin numbering their members starting at 0. You can change this by manually setting the value of one its members. For example, we can start the previous example at 1 instead of 0: - -```TypeScript -enum Color {Red = 1, Green, Blue} -var c: Color = Color.Green; -``` - -Or, even manually set all the values in the enum: - -```TypeScript -enum Color {Red = 1, Green = 2, Blue = 4} -var c: Color = Color.Green; -``` - -A handy feature of enums is that you can also go from a numeric value to the name of that value in the enum. For example, if we had the value 2 but weren't sure which that mapped to in the Color enum above, we could look up the corresponding name: - -```TypeScript -enum Color {Red = 1, Green, Blue} -var colorName: string = Color[2]; - -alert(colorName); -``` - -# Any - -We may need to describe the type of variables that we may not know when we are writing the application. These values may come from dynamic content, eg from the user or 3rd party library. In these cases, we want to opt-out of type-checking and let the values pass through compile-time checks. To do so, we label these with the 'any' type: - -```TypeScript -var notSure: any = 4; -notSure = "maybe a string instead"; -notSure = false; // okay, definitely a boolean -``` - -The 'any' type is a powerful way to work with existing JavaScript, allowing you to gradually opt-in and opt-out of type-checking during compilation. - -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: - -```TypeScript -var list:any[] = [1, true, "free"]; - -list[1] = 100; -``` - -# Void - -Perhaps the opposite in some ways to 'any' is 'void', the absence of having any type at all. You may commonly see this as the return type of functions that do not return a value: - -```TypeScript -function warnUser(): void { - alert("This is my warning message"); -} -``` diff --git a/Classes.md b/Classes.md deleted file mode 100644 index bb7c4554..00000000 --- a/Classes.md +++ /dev/null @@ -1,303 +0,0 @@ -> # Hey, this page is out of date! -> For a more up to date guide, check out [Classes](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Classes.md) at our Handbook repo page. - -# Introduction - -Traditional JavaScript focuses on functions and prototype-based inheritance as the basic means of building up reusable components, but this may feel a bit awkward to programmers more comfortable with an object-oriented approach, where classes inherit functionality and objects are built from these classes. Starting with ECMAScript 6, the next version of JavaScript, JavaScript programmers will be able to build their applications using this object-oriented class-based approach. In TypeScript, we allow developers to use these techniques now, and compile them down to JavaScript that works across all major browsers and platforms, without having to wait for the next version of JavaScript. - -# Classes - -Let's take a look at a simple class-based example: - -```TypeScript -class Greeter { - greeting: string; - constructor(message: string) { - this.greeting = message; - } - greet() { - return "Hello, " + this.greeting; - } -} - -var greeter = new Greeter("world"); -``` - -The syntax should look very familiar if you've used C# or Java before. We declare a new class 'Greeter'. This class has three members, a property called 'greeting', a constructor, and a method 'greet'. - -You'll notice that in the class when we refer to one of the members of the class we prepend 'this.'. This denotes that it's a member access. - -In the last line we construct an instance of the Greeter class using 'new'. This calls into the constructor we defined earlier, creating a new object with the Greeter shape, and running the constructor to initialize it. - -# Inheritance - -In TypeScript, we can use common object-oriented patterns. Of course, one of the most fundamental pattern in class-based programming is being able to extend existing classes to create new ones using inheritance. - -Let's take a look at an example: - -```TypeScript -class Animal { - name:string; - constructor(theName: string) { this.name = theName; } - move(meters: number) { - alert(this.name + " moved " + meters + "m."); - } -} - -class Snake extends Animal { - constructor(name: string) { super(name); } - move() { - alert("Slithering..."); - super.move(5); - } -} - -class Horse extends Animal { - constructor(name: string) { super(name); } - move() { - alert("Galloping..."); - super.move(45); - } -} - -var sam = new Snake("Sammy the Python"); -var tom: Animal = new Horse("Tommy the Palomino"); - -sam.move(); -tom.move(34); -``` - -This example covers quite a bit of the inheritance features in TypeScript that are common to other languages. Here we see using the 'extends' keywords to create a subclass. You can see this where 'Horse' and 'Snake' subclass the base class 'Animal' and gain access to its features. - -The example also shows off being able to override methods in the base class with methods that are specialized for the subclass. Here both 'Snake' and 'Horse' create a 'move' method that overrides the 'move' from 'Animal', giving it functionality specific to each class. - -# Private/Public modifiers - -## Public by default -You may have noticed in the above examples we haven't had to use the word 'public' to make any of the members of the class visible. Languages like C# require that each member be explicitly labelled 'public' to be visible. In TypeScript, each member is public by default. - -You may still mark members a private, so you control what is publicly visible outside of your class. We could have written the 'Animal' class from the previous section like so: - -```TypeScript -class Animal { - private name:string; - constructor(theName: string) { this.name = theName; } - move(meters: number) { - alert(this.name + " moved " + meters + "m."); - } -} -``` - -## Understanding private - -TypeScript is a structural type system. When we compare two different types, regardless of where they came from, if the types of each member are compatible, then we say the types themselves are compatible. - -When comparing types that have 'private' members, we treat these differently. For two types to be considered compatible, if one of them has a private member, then the other must have a private member that originated in the same declaration. - -Let's look at an example to better see how this plays out in practice: - -```TypeScript -class Animal { - private name:string; - constructor(theName: string) { this.name = theName; } -} - -class Rhino extends Animal { - constructor() { super("Rhino"); } -} - -class Employee { - private name:string; - constructor(theName: string) { this.name = theName; } -} - -var animal = new Animal("Goat"); -var rhino = new Rhino(); -var employee = new Employee("Bob"); - -animal = rhino; -animal = employee; //error: Animal and Employee are not compatible -``` - -In this example, we have an 'Animal' and a 'Rhino', with 'Rhino' being a subclass of 'Animal'. We also have a new class 'Employee' that looks identical to 'Animal' in terms of shape. We create some instances of these classes and then try to assign them to each other to see what will happen. Because 'Animal' and 'Rhino' share the private side of their shape from the same declaration of 'private name: string' in 'Animal', they are compatible. However, this is not the case for 'Employee'. When we try to assign from an 'Employee' to 'Animal' we get an error that these types are not compatible. Even though 'Employee' also has a private member called 'name', it is not the same one as the one created in 'Animal'. - -## Parameter properties - -The keywords 'public' and 'private' also give you a shorthand for creating and initializing members of your class, by creating parameter properties. The properties let you can create and initialize a member in one step. Here's a further revision of the previous example. Notice how we drop 'theName' altogether and just use the shortened 'private name: string' parameter on the constructor to create and initialize the 'name' member. - -```TypeScript -class Animal { - constructor(private name: string) { } - move(meters: number) { - alert(this.name + " moved " + meters + "m."); - } -} -``` - -Using 'private' in this way creates and initializes a private member, and similarly for 'public'. - -# Accessors - -TypeScript supports getters/setters as a way of intercepting accesses to a member of an object. This gives you a way of having finer-grained control over how a member is accessed on each object. - -Let's convert a simple class to use 'get' and 'set'. First, let's start with an example without getters and setters. - -```TypeScript -class Employee { - fullName: string; -} - -var employee = new Employee(); -employee.fullName = "Bob Smith"; -if (employee.fullName) { - alert(employee.fullName); -} -``` - -While allowing people to randomly set fullName directly is pretty handy, this might get us in trouble if we people can change names on a whim. - -In this version, we check to make sure the user has a secret passcode available before we allow them to modify the employee. We do this by replacing the direct access to fullName with a 'set' that will check the passcode. We add a corresponding 'get' to allow the previous example to continue to work seamlessly. - -```TypeScript -var passcode = "secret passcode"; - -class Employee { - private _fullName: string; - - get fullName(): string { - return this._fullName; - } - - set fullName(newName: string) { - if (passcode && passcode == "secret passcode") { - this._fullName = newName; - } - else { - alert("Error: Unauthorized update of employee!"); - } - } -} - -var employee = new Employee(); -employee.fullName = "Bob Smith"; -if (employee.fullName) { - alert(employee.fullName); -} -``` - -To prove to ourselves that our accessor is now checking the passcode, we can modify the passcode and see that when it doesn't match we instead get the alert box warning us we don't have access to update the employee. - -Note: Accessors require you to set the compiler to output ECMAScript 5. - -# Static Properties - -Up to this point, we've only talked about the _instance_ members of the class, those that show up on the object when its instantiated. We can also create _static_ members of a class, those that are visible on the class itself rather than on the instances. In this example, we use 'static' on the origin, as it's a general value for all grids. Each instance accesses this value through prepending the name of the class. Similarly to prepending 'this.' in front of instance accesses, here we prepend 'Grid.' in front of static accesses. - -```TypeScript -class Grid { - static origin = {x: 0, y: 0}; - calculateDistanceFromOrigin(point: {x: number; y: number;}) { - var xDist = (point.x - Grid.origin.x); - var yDist = (point.y - Grid.origin.y); - return Math.sqrt(xDist * xDist + yDist * yDist) / this.scale; - } - constructor (public scale: number) { } -} - -var grid1 = new Grid(1.0); // 1x scale -var grid2 = new Grid(5.0); // 5x scale - -alert(grid1.calculateDistanceFromOrigin({x: 10, y: 10})); -alert(grid2.calculateDistanceFromOrigin({x: 10, y: 10})); -``` - -# Advanced Techniques - -## Constructor functions - -When you declare a class in TypeScript, you are actually creating multiple declarations at the same time. The first is the type of the _instance_ of the class. - -```TypeScript -class Greeter { - greeting: string; - constructor(message: string) { - this.greeting = message; - } - greet() { - return "Hello, " + this.greeting; - } -} - -var greeter: Greeter; -greeter = new Greeter("world"); -alert(greeter.greet()); -``` - -Here, when we say 'var greeter: Greeter', we're using Greeter as the type of instances of the class Greeter. This is almost second nature to programmers from other object-oriented languages. - -We're also creating another value that we call the _constructor function_. This is the function that is called when we 'new' up instances of the class. To see what this looks like in practice, let's take a look at the JavaScript created by the above example: - -```TypeScript -var Greeter = (function () { - function Greeter(message) { - this.greeting = message; - } - Greeter.prototype.greet = function () { - return "Hello, " + this.greeting; - }; - return Greeter; -})(); - -var greeter; -greeter = new Greeter("world"); -alert(greeter.greet()); -``` - -Here, 'var Greeter' is going to be assigned the constructor function. When we call 'new' and run this function, we get an instance of the class. The constructor function also contains all of the static members of the class. Another way to think of each class is that there is an _instance_ side and a _static_ side. - -Let's modify the example a bit to show this difference: - -```TypeScript -class Greeter { - static standardGreeting = "Hello, there"; - greeting: string; - greet() { - if (this.greeting) { - return "Hello, " + this.greeting; - } - else { - return Greeter.standardGreeting; - } - } -} - -var greeter1: Greeter; -greeter1 = new Greeter(); -alert(greeter1.greet()); - -var greeterMaker: typeof Greeter = Greeter; -greeterMaker.standardGreeting = "Hey there!"; -var greeter2:Greeter = new greeterMaker(); -alert(greeter2.greet()); -``` - -In this example, 'greeter1' works similarly to before. We instantiate the 'Greeter' class, and use this object. This we have seen before. - -Next, we then use the class directly. Here we create a new variable called 'greeterMaker'. This variable will hold the class itself, or said another way its constructor function. Here we use 'typeof Greeter', that is "give me the type of the Greeter class itself" rather than the instance type. Or, more precisely, "give me the type of the symbol called Greeter", which is the type of the constructor function. This type will contain all of the static members of Greeter along with the constructor that creates instances of the Greeter class. We show this by using 'new' on 'greeterMaker', creating new instances of 'Greeter' and invoking them as before. - -## Using a class as an interface - -As we said in the previous section, a class declaration creates two things: a type representing instances of the class and a constructor function. Because classes create types, you can use them in the same places you would be able to use interfaces. - -```TypeScript -class Point { - x: number; - y: number; -} - -interface Point3d extends Point { - z: number; -} - -var point3d: Point3d = {x: 1, y: 2, z: 3}; -``` diff --git a/Declaration-Merging.md b/Declaration-Merging.md deleted file mode 100644 index 78ad7f3e..00000000 --- a/Declaration-Merging.md +++ /dev/null @@ -1,203 +0,0 @@ -> # Hey, this page is out of date! -> For a more up to date guide, check out [Declaration Merging](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Declaration%20Merging.md) at our Handbook repo page. - -# Introduction - -Some of the unique concepts in TypeScript comes from the necessity of describing what is happening to the shape of JavaScript objects at the type level. One example that is especially unique to TypeScript is the concept of 'declaration merging'. Understanding this concept will give you an advantage when working with existing JavaScript in your TypeScript. It also opens the door to more advanced abstraction concepts. - -First, before we get into how declarations merge, let's first describe what we mean by 'declaration merging'. - -For the purposes of this article, declaration merging specifically means that the compiler is doing the work of merging two separate declarations declared with the same name into a single definition. This merged definition has the features of both of the original declarations. Declaration merging is not limited to just two declarations, as any number of declarations can be merged. - -# Basic Concepts - -In TypeScript, a declaration exists in one of three groups: namespace/module, type, or value. Declarations that create a namespace/module are accessed using a dotted notation when writing a type. Declarations that create a type do just that, create a type that is visible with the declared shape and bound to the given name. Lastly, declarations create a value are those that are visible in the output JavaScript (eg, functions and variables). - - - - - - - - - - - - - - - - - - - - -
Declaration TypeNamespaceTypeValue
Module X X
Class X X
Interface X
Function X
Variable X
- -Understanding what is created with each declaration will help you understand what is merged when you perform a declaration merge. - -# Merging Interfaces - -The simplest, and perhaps most common, type of declaration merging is interface merging. At the most basic level, the merge mechanically joins the members of both declarations into a single interface with the same name. - -```TypeScript -interface Box { - height: number; - width: number; -} - -interface Box { - scale: number; -} - -var box: Box = {height: 5, width: 6, scale: 10}; -``` - -Non-function members of the interfaces must be unique. The compiler will issue an error if the interfaces both declare a non-function member of the same name. - -For function members, each function member of the same name is treated as describing an overload of the same function. Of note, too, is that in the case of interface A merging with later interface A (here called A'), the overload set of A' will have a higher precedence than that of interface A. - -That is, in the example: - -```TypeScript -interface Document { - createElement(tagName: any): Element; -} -interface Document { - createElement(tagName: string): HTMLElement; -} -interface Document { - createElement(tagName: "div"): HTMLDivElement; - createElement(tagName: "span"): HTMLSpanElement; - createElement(tagName: "canvas"): HTMLCanvasElement; -} -``` - -The two interfaces will merge to create a single declaration. Notice that the elements of each group maintains the same order, just the groups themselves are merged with later overload sets coming first: - -```TypeScript -interface Document { - createElement(tagName: "div"): HTMLDivElement; - createElement(tagName: "span"): HTMLSpanElement; - createElement(tagName: "canvas"): HTMLCanvasElement; - createElement(tagName: string): HTMLElement; - createElement(tagName: any): Element; -} -``` - -# Merging Modules - -Similarly to interfaces, modules of the same name will also merge their members. Since modules create both a namespace and a value, we need to understand how both merge. - -To merge the namespaces, type definitions from exported interfaces declared in each module are themselves merged, forming a single namespace with merged interface definitions inside. - -To merge the value, at each declaration site, if a module already exists with the given name, it is further extended by taking the existing module and adding the exported members of the second module to the first. - -The declaration merge of 'Animals' in this example: - -```TypeScript -module Animals { - export class Zebra { } -} - -module Animals { - export interface Legged { numberOfLegs: number; } - export class Dog { } -} -``` - -is equivalent to: - -```TypeScript -module Animals { - export interface Legged { numberOfLegs: number; } - - export class Zebra { } - export class Dog { } -} -``` - -This model of module merging is a helpful starting place, but to get a more complete picture we need to also understand what happens with non-exported members. Non-exported members are only visible in the original (un-merged) module. This means that after merging, merged members that came from other declarations can not see non-exported members. - -We can see this more clearly in this example: - -```TypeScript -module Animal { - var haveMuscles = true; - - export function animalsHaveMuscles() { - return haveMuscles; - } -} - -module Animal { - export function doAnimalsHaveMuscles() { - return haveMuscles; // <-- error, haveMuscles is not visible here - } -} -``` - -Because haveMuscles is not exported, only the animalsHaveMuscles function that shares the same un-merged module can see the symbol. The doAnimalsHaveMuscles function, even though it's part of the merged Animal module can not see this un-exported member. - -# Merging Modules with Classes, Functions, and Enums - -Modules are flexible enough to also merge with other types of declarations. To do so, the module declaration must follow the declaration it will merge with. The resulting declaration has properties of both declaration types. TypeScript uses this capability to model some of patterns in JavaScript as well as other programming languages. - -The first module merge we'll cover is merging a module with a class. This gives the user a way of describing inner classes. - -```TypeScript -class Album { - label: Album.AlbumLabel; -} -module Album { - export class AlbumLabel { } -} -``` - -The visibility rules for merged members is the same as described in the 'Merging Modules' section, so we must export the AlbumLabel class for the merged class to see it. The end result is a class managed inside of another class. You can also use modules to add more static members to an existing class. - -In addition to the pattern of inner classes, you may also be familiar with JavaScript practice of creating a function and then extending the function further by adding properties onto the function. TypeScript uses declaration merging to build up definitions like this in a type-safe way. - -```TypeScript -function buildLabel(name: string): string { - return buildLabel.prefix + name + buildLabel.suffix; -} - -module buildLabel { - export var suffix = ""; - export var prefix = "Hello, "; -} - -alert(buildLabel("Sam Smith")); -``` - -Similarly, modules can be used to extend enums with static members: - -```TypeScript -enum Color { - red = 1, - green = 2, - blue = 4 -} - -module Color { - export function mixColor(colorName: string) { - if (colorName == "yellow") { - return Color.red + Color.green; - } - else if (colorName == "white") { - return Color.red + Color.green + Color.blue; - } - else if (colorName == "magenta") { - return Color.red + Color.blue; - } - else if (colorName == "cyan") { - return Color.green + Color.blue; - } - } -} -``` - -# Disallowed Merges - -Not all merges are allowed in TypeScript. Currently, classes can not merge with other classes, variables and classes can not merge, nor can interfaces and classes. For information on mimicking classes merging, see the [Mixins](Mixins) section. \ No newline at end of file diff --git a/Functions.md b/Functions.md deleted file mode 100644 index b92aa86a..00000000 --- a/Functions.md +++ /dev/null @@ -1,293 +0,0 @@ -> # Hey, this page is out of date! -> For a more up to date guide, check out [Functions](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Functions.md) at our Handbook repo page. - -# Introduction - -Functions are the fundamental building block of any applications in JavaScript. They're how you build up layers of abstraction, mimicking classes, information hiding, and modules. In TypeScript, while there are classes and modules, function still play the key role in describing how to 'do' things. TypeScript also adds some new capabilities to the standard JavaScript functions to make them easier to work with. - -# Functions - -To begin, just as in JavaScript, TypeScript functions can be created both as a named function or as an anonymous function. This allows you to choose the most appropriate approach for your application, whether you're building a list of functions in an API or a one-off function to hand off to another function. - -To quickly recap what these two approaches look like in JavaScript: - -```TypeScript -//Named function -function add(x, y) { - return x+y; -} - -//Anonymous function -var myAdd = function(x, y) { return x+y; }; -``` - -Just as in JavaScript, functions can return to variables outside of the function body. When they do so, they're said to 'capture' these variables. While understanding how this works, and the trade-offs when using this technique, are outside of the scope of this article, having a firm understanding how this mechanic is an important piece of working with JavaScript and TypeScript. - -```TypeScript -var z = 100; - -function addToZ(x, y) { - return x+y+z; -} -``` - -# Function Types - -## Typing the function - -Let's add types to our simple examples from earlier: - -```TypeScript -function add(x: number, y: number): number { - return x+y; -} - -var myAdd = function(x: number, y: number): number { return x+y; }; -``` - -We can add types to each of the parameters and then to the function itself to add a return type. TypeScript can figure the return type out by looking at the return statements, so we can also optionally leave this off in many cases. - -## Writing the function type - -Now that we've typed the function, let's write the full type of the function out by looking at the each piece of the function type. - -```TypeScript -var myAdd: (x:number, y:number)=>number = - function(x: number, y: number): number { return x+y; }; -``` - -A function's type has the same two parts: the type of the arguments and the return type. When writing out the whole function type, both parts are required. We write out the parameter types just like a parameter list, giving each parameter a name and a type. This name is just to help with readability. We could have instead written: - -```TypeScript -var myAdd: (baseValue:number, increment:number)=>number = - function(x: number, y: number): number { return x+y; }; -``` - -As long as the parameter types line up, it's considered a valid type for the function, regardless of the names you give the parameters in the function type. - -The second part is the return type. We make it clear which is the return type by using a fat arrow (=>) between the parameters and the return type. As mentioned before, this is a required part of the function type, so if the function doesn't return a value, you would use 'void' instead of leaving it off. - -Of note, only the parameters and the return type make up the function type. Captured variables are not reflected in the type. In effect, captured variables are part of the 'hidden state' of any function and do not make up its API. - -## Inferring the types - -In playing with the example, you may notice that the TypeScript compiler can figure out the type if you have types on one side of the equation but not the other: - -```TypeScript -// myAdd has the full function type -var myAdd = function(x: number, y: number): number { return x+y; }; - -// The parameters 'x' and 'y' have the type number -var myAdd: (baseValue:number, increment:number)=>number = - function(x, y) { return x+y; }; -``` - -This is called 'contextual typing', a form of type inference. This helps cut down on the amount of effort to keep your program typed. - -# Optional and Default Parameters - -Unlike JavaScript, in TypeScript every parameter to a function is assumed to be required by the function. This doesn't mean that it isn't a 'null' value, but rather, when the function is called the compiler will check that the user has provided a value for each parameter. The compiler also assumes that these parameters are the only parameters that will be passed to the function. In short, the number of parameters to the function has to match the number of parameters the function expects. - -```TypeScript -function buildName(firstName: string, lastName: string) { - return firstName + " " + lastName; -} - -var result1 = buildName("Bob"); //error, too few parameters -var result2 = buildName("Bob", "Adams", "Sr."); //error, too many parameters -var result3 = buildName("Bob", "Adams"); //ah, just right -``` - -In JavaScript, every parameter is considered optional, and users may leave them off as they see fit. When they do, they're assumed to be undefined. We can get this functionality in TypeScript by using the '?' beside parameters we want optional. For example, let's say we want the last name to be optional: - -```TypeScript -function buildName(firstName: string, lastName?: string) { - if (lastName) - return firstName + " " + lastName; - else - return firstName; -} - -var result1 = buildName("Bob"); //works correctly now -var result2 = buildName("Bob", "Adams", "Sr."); //error, too many parameters -var result3 = buildName("Bob", "Adams"); //ah, just right -``` - -Optional parameters must follow required parameters. Had we wanted to make the first name optional rather than the last name, we would need to change the order of parameters in the function, putting the first name last in the list. - -In TypeScript, we can also set up a value that an optional parameter will have if the user does not provide one. These are called default parameters. Let's take the previous example and default the last name to "Smith". - -```TypeScript -function buildName(firstName: string, lastName = "Smith") { - return firstName + " " + lastName; -} - -var result1 = buildName("Bob"); //works correctly now, also -var result2 = buildName("Bob", "Adams", "Sr."); //error, too many parameters -var result3 = buildName("Bob", "Adams"); //ah, just right -``` - -Just as with optional parameters, default parameters must come after required parameters in the parameter list. - -Optional parameters and default parameters also share what the type looks like. Both: - -```TypeScript -function buildName(firstName: string, lastName?: string) { -``` - -and - -```TypeScript -function buildName(firstName: string, lastName = "Smith") { -``` - -share the same type "(firstName: string, lastName?: string)=>string". The default value of the default parameter disappears, leaving only the knowledge that the parameter is optional. - -# Rest Parameters - -Required, optional, and default parameters all have one thing in common: they're about talking about one parameter at a time. Sometimes, you want to work with multiple parameters as a group, or you may not know how many parameters a function will ultimately take. In JavaScript, you can work with the arguments direction using the {{arguments}} variable that is visible inside every function body. - -In TypeScript, you can gather these arguments together into a variable: - -```TypeScript -function buildName(firstName: string, ...restOfName: string[]) { - return firstName + " " + restOfName.join(" "); -} - -var employeeName = buildName("Joseph", "Samuel", "Lucas", "MacKinzie"); -``` - -Rest parameters are treated as a boundless number of optional parameters. You may leave them off, or have as many as you want. The compiler will build an array of the arguments you pass to the function under the name given after the ellipsis (...), allowing you to use it in your function. - -The ellipsis is also used in the type of the function with rest parameters: - -```TypeScript -function buildName(firstName: string, ...restOfName: string[]) { - return firstName + " " + restOfName.join(" "); -} - -var buildNameFun: (fname: string, ...rest: string[])=>string = buildName; -``` - -# Lambdas and using 'this' - -How 'this' works in JavaScript functions is a common theme in programmers coming to JavaScript. Indeed, learning how to use it is something of a rite of passage as developers become more accustomed to working in JavaScript. Since TypeScript is a superset of JavaScript, TypeScript developers also need to learn how to use 'this' and how to spot when it's not being used correctly. A whole article could be written on how to use 'this' in JavaScript, and many have. Here, we'll focus on some of the basics. - -In JavaScript, 'this' is a variable that's set when a function is called. This makes it a very powerful and flexible feature, but it comes at the cost of always having to know about the context that a function is executing in. This can be notoriously confusing, when, for example, when a function is used as a callback. - -Let's look at an example: - -```TypeScript -var deck = { - suits: ["hearts", "spades", "clubs", "diamonds"], - cards: Array(52), - createCardPicker: function() { - return function() { - var pickedCard = Math.floor(Math.random() * 52); - var pickedSuit = Math.floor(pickedCard / 13); - - return {suit: this.suits[pickedSuit], card: pickedCard % 13}; - } - } -} - -var cardPicker = deck.createCardPicker(); -var pickedCard = cardPicker(); - -alert("card: " + pickedCard.card + " of " + pickedCard.suit); -``` - -If we tried to run the example, we would get an error instead of the expected alert box. This is because the 'this' being used in the function created by 'createCardPicker' will be set to 'window' instead of our 'deck' object. This happens as a result of calling 'cardPicker()'. Here, there is no dynamic binding for 'this' other than Window. (note: under strict mode, this will be undefined rather than window). - -We can fix this by making sure the function is bound to the correct 'this' before we return the function to be used later. This way, regardless of how its later used, it will still be able to see the original 'deck' object. - -To fix this, we switching the function expression to use the lambda syntax ( ()=>{} ) rather than the JavaScript function expression. This will automatically capture the 'this' available when the function is created rather than when it is invoked: - -```TypeScript -var deck = { - suits: ["hearts", "spades", "clubs", "diamonds"], - cards: Array(52), - createCardPicker: function() { - // Notice: the line below is now a lambda, allowing us to capture 'this' earlier - return () => { - var pickedCard = Math.floor(Math.random() * 52); - var pickedSuit = Math.floor(pickedCard / 13); - - return {suit: this.suits[pickedSuit], card: pickedCard % 13}; - } - } -} - -var cardPicker = deck.createCardPicker(); -var pickedCard = cardPicker(); - -alert("card: " + pickedCard.card + " of " + pickedCard.suit); -``` - -For more information on ways to think about 'this', you can read Yahuda Katz's [Understanding JavaScript Function Invocation and “this”](http://yehudakatz.com/2011/08/11/understanding-javascript-function-invocation-and-this/). - -# Overloads - -JavaScript is inherently a very dynamic language. It's not uncommon for a single JavaScript function to return different types of objects based on the shape of the arguments passed in. - -```TypeScript -var suits = ["hearts", "spades", "clubs", "diamonds"]; - -function pickCard(x): any { - // Check to see if we're working with an object/array - // if so, they gave us the deck and we'll pick the card - if (typeof x == "object") { - var pickedCard = Math.floor(Math.random() * x.length); - return pickedCard; - } - // Otherwise just let them pick the card - else if (typeof x == "number") { - var pickedSuit = Math.floor(x / 13); - return { suit: suits[pickedSuit], card: x % 13 }; - } -} - -var myDeck = [{ suit: "diamonds", card: 2 }, { suit: "spades", card: 10 }, { suit: "hearts", card: 4 }]; -var pickedCard1 = myDeck[pickCard(myDeck)]; -alert("card: " + pickedCard1.card + " of " + pickedCard1.suit); - -var pickedCard2 = pickCard(15); -alert("card: " + pickedCard2.card + " of " + pickedCard2.suit); -``` - -Here the 'pickCard' function will return two different things based on what the user has passed in. If the users passes in an object that represents the deck, the function will pick the card. If the user picks the card, we tell them which card they've picked. But how do we describe this to the type system. - -The answer is to supply multiple function types for the same function as a list of overloads. This list is what the compiler will use to resolve function calls. Let's create a list of overloads that describe what our 'pickCard' accepts and what it returns. - -```TypeScript -var suits = ["hearts", "spades", "clubs", "diamonds"]; - -function pickCard(x: {suit: string; card: number; }[]): number; -function pickCard(x: number): {suit: string; card: number; }; -function pickCard(x): any { - // Check to see if we're working with an object/array - // if so, they gave us the deck and we'll pick the card - if (typeof x == "object") { - var pickedCard = Math.floor(Math.random() * x.length); - return pickedCard; - } - // Otherwise just let them pick the card - else if (typeof x == "number") { - var pickedSuit = Math.floor(x / 13); - return { suit: suits[pickedSuit], card: x % 13 }; - } -} - -var myDeck = [{ suit: "diamonds", card: 2 }, { suit: "spades", card: 10 }, { suit: "hearts", card: 4 }]; -var pickedCard1 = myDeck[pickCard(myDeck)]; -alert("card: " + pickedCard1.card + " of " + pickedCard1.suit); - -var pickedCard2 = pickCard(15); -alert("card: " + pickedCard2.card + " of " + pickedCard2.suit); -``` - -With this change, the overloads now give us type-checked calls to the 'pickCard' function. - -In order for the compiler to pick the correct typecheck, it follows a similar process to the underlying JavaScript. It looks at the overload list, and proceeding with the first overload attempts to call the function with the provided parameters. If it finds a match, it picks this overload as the correct overload. For this reason, its customary to order overloads from most specific to least specific. - -Note that the 'function pickCard(x): any' piece is not part of the overload list, so it only has two overloads: one that takes an object and one that takes a number. Calling 'pickCard' with any other parameter types would cause an error. diff --git a/Generics.md b/Generics.md deleted file mode 100644 index 7aead392..00000000 --- a/Generics.md +++ /dev/null @@ -1,300 +0,0 @@ -> # Hey, this page is out of date! -> For a more up to date guide, check out [Generics](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Generics.md) at our Handbook repo page. - -# Introduction - -A major part of software engineering is building components that not only have well-defined and consistent APIs, but are also reusable. Components that are capable of working on the data of today as well as the data of tomorrow will give you the most flexible capabilities for building up large software systems. - -In languages like C# and Java, one of the main tools in the toolbox for creating reusable components is 'generics', that is, being able to create a component that can work over a variety of types rather than a single one. This allows users to consume these components and use their own types. - -# Hello World of Generics - -To start off, let's do the "hello world" of generics: the identity function. The identity function is a function that will return back whatever is passed in. You can think of this in a similar way to the 'echo' command. - -Without generics, we would either have to give the identity function a specific type: - -```TypeScript -function identity(arg: number): number { - return arg; -} -``` - -Or, we could describe the identity function using the 'any' type: - -```TypeScript -function identity(arg: any): any { - return arg; -} -``` - -While using 'any' is certainly generic in that will accept any and all types for the type of 'arg', we actually are losing the information about what that type was when the function returns. If we passed in a number, the only information we have is that any type could be returned. - -Instead, we need a way of capturing the type of the argument in such a way that we can also use it to denote what is being returned. Here, we will use a _type variable_, a special kind of variable that works on types rather than values. - -```TypeScript -function identity(arg: T): T { - return arg; -} -``` - -We've now added a type variable 'T' to the identity function. This 'T' allows us to capture the type the user provides (eg, number), so that we can use that information later. Here, we use 'T' again as the return type. On inspection, we can now see the same type is used for the argument and the return type. This allows us to traffic that type information in one side of the function and out the other. - -We say that this version of the 'identity' function is generic, as it works over a range of types. Unlike using 'any', it's also just as precise (ie, it doesn't lose any information) as the first 'identity' function that used numbers for the argument and return type. - -Once we've written the generic identity function, we can call it in one of two ways. The first way is to pass all of the arguments, including the type argument, to the function: - -```TypeScript -var output = identity("myString"); // type of output will be 'string' -``` - -Here we explicitly set 'T' to be string as one of the arguments to the function call, denoted using the <> around the arguments rather than (). - -The second way is also perhaps the most common. Here we use /type argument inference/, that is, we want the compiler to set the value of T for us automatically based on the type of the argument we pass in: - -```TypeScript -var output = identity("myString"); // type of output will be 'string' -``` - -Notice that we didn't have explicitly pass the type in the angle brackets (<>), the compiler just looked at the value "myString", and set T to its type. While type argument inference can be a helpful tool to keep code shorter and more readable, you may need to explicitly pass in the type arguments as we did in the previous example when the compiler fails to infer the type, as may happen in more complex examples. - -! Working with Generic Type Variables - -When you begin to use generics, you'll notice that when you create generic functions like 'identity', the compiler will enforce that you use any generically typed parameters in the body of the function correctly. That is, that you actually treat these parameters as if they could be any and all types. - -Let's take our 'identity' function from earlier: - -```TypeScript -function identity(arg: T): T { - return arg; -} -``` - -What if we want to also log the length of the argument 'arg' to the console with each call? We might be tempted to write this: - -```TypeScript -function loggingIdentity(arg: T): T { - console.log(arg.length); // Error: T doesn't have .length - return arg; -} -``` - -When we do, the compiler will give us an error that we're using the ".length" member of 'arg', but nowhere have we said that 'arg' has this member. Remember, we said earlier that these type variables stand in for any and all types, so someone using this function could have passed in a 'number' instead, which does not have a ".length" member. - -Let's say that we've actually intended this function to work on arrays of T rather that T directly. Since we're working with arrays, the .length member should be available. We can describe this just like we would create arrays of other types: - -```TypeScript -function loggingIdentity(arg: T[]): T[] { - console.log(arg.length); // Array has a .length, so no more error - return arg; -} -``` - -You can read the type of logging Identity as "the generic function loggingIdentity, takes a type parameter T, and an argument 'arg' which is an array of these T's, and returns an array of T's. If we passed in an array of numbers, we'd get an array of numbers back out, as T would bind to number. This allows us to use our generic type variable 'T' as part of the types we're working with, rather than the whole type, giving us greater flexibility. - -We can alternatively write the sample example this way: - -```TypeScript -function loggingIdentity(arg: Array): Array { - console.log(arg.length); // Array has a .length, so no more error - return arg; -} -``` - -You may already be familiar with this style of type from other languages. In the next section, we'll cover how you can create your own generic types like Array. - -# Generic Types - -In previous sections, we created generic identity functions that worked over a range of types. In this section, we'll explore the type of the functions themselves and how to create generic interfaces. - -The type of generic functions is just like those of non-generic functions, with the type parameters listed first, similarly to function declarations: - -```TypeScript -function identity(arg: T): T { - return arg; -} - -var myIdentity: (arg: T)=>T = identity; -``` - -We could also have used a different name for the generic type parameter in the type, so long as the number of type variables and how the type variables are used line up. - -```TypeScript -function identity(arg: T): T { - return arg; -} - -var myIdentity: (arg: U)=>U = identity; -``` - -We can also write the generic type as a call signature of an object literal type: - -```TypeScript -function identity(arg: T): T { - return arg; -} - -var myIdentity: {(arg: T): T} = identity; -``` - -Which leads us to writing our first generic interface. Let's take the object literal from the previous example and move it to an interface: - -```TypeScript -interface GenericIdentityFn { - (arg: T): T; -} - -function identity(arg: T): T { - return arg; -} - -var myIdentity: GenericIdentityFn = identity; -``` - -In a similar example, we may want to move the generic parameter to be a parameter of the whole interface. This lets us see what type(s) we're generic over (eg Dictionary rather than just Dictionary). This makes the type parameter visible to all the other members of the interface. - -```TypeScript -interface GenericIdentityFn { - (arg: T): T; -} - -function identity(arg: T): T { - return arg; -} - -var myIdentity: GenericIdentityFn = identity; -``` - -Notice that our example has changed to be something slightly different. Instead of describing a generic function, we now have a non-generic function signature that is a part of a generic type. When we use GenericIdentityFn, we now will also need to specify the corresponding type argument (here: number), effectively locking in what the underlying call signature will use. Understanding when to put the type parameter directly on the call signature and when to put it on the interface itself will be helpful in describing what aspects of a type are generic. - -In addition to generic interfaces, we can also create generic classes. Note that it is not possible to create generic enums and modules. - -# Generic Classes - -A generic class has a similar shape to a generic interface. Generic classes have a generic type parameter list in angle brackets (<>) following the name of the class. - -```TypeScript -class GenericNumber { - zeroValue: T; - add: (x: T, y: T) => T; -} - -var myGenericNumber = new GenericNumber(); -myGenericNumber.zeroValue = 0; -myGenericNumber.add = function(x, y) { return x + y; }; -``` - -This is a pretty literal use of the 'GenericNumber' class, but you may have noticed that nothing is restricting is to only use the 'number' type. We could have instead used 'string' or even more complex objects. - -```TypeScript -var stringNumeric = new GenericNumber(); -stringNumeric.zeroValue = ""; -stringNumeric.add = function(x, y) { return x + y; }; - -alert(stringNumeric.add(stringNumeric.zeroValue, "test")); -``` - -Just as with interface, putting the type parameter on the class itself lets us make sure all of the properties of the class are working with the same type. - -As we covered in [Classes](Classes), a class as two side to its type: the static side and the instance side. Generic classes are only generic over their instance side rather than their static side, so when working with classes, static members can not use the class's type parameter. - -# Generic Constraints - -If you remember from an earlier example, you may sometimes want to write a generic function that works on a set of types where you have some knowledge about what capabilities that set of types will have. In our 'loggingIdentity' example, we wanted to be able access the ".length" property of 'arg', but the compiler could not prove that every type had a ".length" property, so it warns us that we can't make this assumption. - -```TypeScript -function loggingIdentity(arg: T): T { - console.log(arg.length); // Error: T doesn't have .length - return arg; -} -``` - -Instead of working with any and all types, we'd like to constrain this function to work with any and all types that also have the ".length" property. As long as the type has this member, we'll allow it, but it's required to have at least this member. To do so, we must list our requirement as a constraint on what T can be. - -To do so, we'll create an interface that describes our constraint. Here, we'll create an interface that has a single ".length" property and then we'll use this interface and the 'extends' keyword to denote our constraint: - -```TypeScript -interface Lengthwise { - length: number; -} - -function loggingIdentity(arg: T): T { - console.log(arg.length); // Now we know it has a .length property, so no more error - return arg; -} -``` - -Because the generic function is now constrained, it will no longer work over any and all types: - -```TypeScript -loggingIdentity(3); // Error, number doesn't have a .length property -``` - -Instead, we need to pass in values whose type has all the required properties: - -```TypeScript -loggingIdentity({length: 10, value: 3}); -``` - -## Using Type Parameters in Generic Constraints - -In some cases, it may be useful to declare a type parameter that is constrained by another type parameter. For example, - -```TypeScript -function find>(n: T, s: U) { // errors because type parameter used in constraint - // ... -} -find (giraffe, myAnimals); -``` - -You can achieve the pattern above by replacing the type parameter with its constraint. Rewriting the example above, - -```TypeScript -function find(n: T, s: Findable) { // errors because type parameter used in constraint - // ... -} -find(giraffe, myAnimals); -``` - -_Note:_ The above is not strictly identical, as the return type of the first function could have returned 'U', which the second function pattern does not provide a means to do. - -## Using Class Types in Generics - -When creating factories in TypeScript using generics, it is necessary to refer to class types by their constructor functions. For example, - -```TypeScript -function create(c: {new(): T; }): T { - return new c(); -} -``` - -A more advanced example uses the prototype property to infer and constrain relationships between the constructor function and the instance side of class types. - -```TypeScript -class BeeKeeper { - hasMask: boolean; -} - -class ZooKeeper { - nametag: string; -} - -class Animal { - numLegs: number; -} - -class Bee extends Animal { - keeper: BeeKeeper; -} - -class Lion extends Animal { - keeper: ZooKeeper; -} - -function findKeeper (a: {new(): A; - prototype: {keeper: K}}): K { - - return null; -} - -findKeeper(Lion).nametag; // works! -``` diff --git a/Interfaces.md b/Interfaces.md deleted file mode 100644 index 9dbcd299..00000000 --- a/Interfaces.md +++ /dev/null @@ -1,285 +0,0 @@ -> # Hey, this page is out of date! -> For a more up to date guide, check out [Interfaces](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Interfaces.md) at our Handbook repo page. - -# Introduction - -One of TypeScript's core principles is that type-checking focuses on the 'shape' that values have. This is sometimes called "duck typing" or "structural subtyping". In TypeScript, interfaces fill the role of naming these types, and are a powerful way of defining contracts within your code as well as contracts with code outside of your project. - -# Our First Interface - -The easiest way to see how interfaces work is to start with a simple example: - -```TypeScript -function printLabel(labelledObj: {label: string}) { - console.log(labelledObj.label); -} - -var myObj = {size: 10, label: "Size 10 Object"}; -printLabel(myObj); -``` - -The type-checker checks the call to 'printLabel'. The 'printLabel' function has a single parameter that requires that the object passed in as a property called 'label' of type string. Notice that our object actually has more properties than this, but the compiler only checks to that _at least_ the ones required are present and match the types required. - -We can write the same example again, this time using an interface to describe the requirement of having the 'label' property that is a string: - -```TypeScript -interface LabelledValue { - label: string; -} - -function printLabel(labelledObj: LabelledValue) { - console.log(labelledObj.label); -} - -var myObj = {size: 10, label: "Size 10 Object"}; -printLabel(myObj); -``` - -The interface 'LabelledValue' is a name we can now use to describe the requirement in the previous example. It still represents having a single property called 'label' that is of type string. Notice we didn't have to explicitly say that the object we pass to 'printLabel' implements this interface like we might have to in other languages. Here, it's only the shape that matters. If the object we pass to the function meets the requirements listed, then it's allowed. - -It's worth pointing out that the type-checker does not require that these properties come in any sort of order, only that the properties the interface requires are present and have the required type. - -# Optional Properties -Not every properties of an interface may be required. Some exist under certain conditions or may not be there at all. These optional properties are popular when creating patterns like "option bags" where the user passes an object to a function that only has a couple properties filled in. - -Here's as example of this pattern: - -```TypeScript -interface SquareConfig { - color?: string; - width?: number; -} - -function createSquare(config: SquareConfig): {color: string; area: number} { - var newSquare = {color: "white", area: 100}; - if (config.color) { - newSquare.color = config.color; - } - if (config.width) { - newSquare.area = config.width * config.width; - } - return newSquare; -} - -var mySquare = createSquare({color: "black"}); -``` - -Interfaces with optional properties are written similar to other interfaces, which each optional property denoted with a '?' as part of the property declaration. - -The advantage of optional properties is that you can describe these possibly available properties while still also catching properties that you know are not expected to be available. For example, had we mistyped the name of the property we passed to 'createSquare', we would get an error message letting us know: - -```TypeScript -interface SquareConfig { - color?: string; - width?: number; -} - -function createSquare(config: SquareConfig): {color: string; area: number} { - var newSquare = {color: "white", area: 100}; - if (config.color) { - newSquare.color = config.collor; // Type-checker can catch the mistyped name here - } - if (config.width) { - newSquare.area = config.width * config.width; - } - return newSquare; -} - -var mySquare = createSquare({color: "black"}); -``` - -# Function Types - -Interfaces are capable of describing the wide range of shapes that JavaScript objects can take. In addition to describing an object with properties, interfaces are also capable of describing function types. - -To describe a function type with an interface, we give the interface a call signature. This is like a function declaration with only the parameter list and return type given. - -```TypeScript -interface SearchFunc { - (source: string, subString: string): boolean; -} -``` - -Once defined, we can use this function type interface like we would other interfaces. Here, we show how you can create a variable of a function type and assign it a function value of the same type. - -```TypeScript -var mySearch: SearchFunc; -mySearch = function(source: string, subString: string) { - var result = source.search(subString); - if (result == -1) { - return false; - } - else { - return true; - } -} -``` - -For function types to correctly type-check, the name of the parameters do not need to match. We could have, for example, written the above example like this: - -```TypeScript -var mySearch: SearchFunc; -mySearch = function(src: string, sub: string) { - var result = src.search(sub); - if (result == -1) { - return false; - } - else { - return true; - } -} -``` - -Function parameters are checked one at a time, with the type in each corresponding parameter position checked against each other. 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. - -# Array Types - -Similarly to how we can use interfaces to describe function types, we can also describe array types. Array types have an 'index' type that describes the types allowed to index the object, along with the corresponding return type for accessing the index. - -```TypeScript -interface StringArray { - [index: number]: string; -} - -var myArray: StringArray; -myArray = ["Bob", "Fred"]; -``` - -There are two types of supported index types: string and number. It is possible to support both types of index, with the restriction that the type returned from the numeric index must be a subtype of the type returned from the string index. - -While index signatures are a powerful way to describe the array and 'dictionary' pattern, they also enforce that all properties match their return type. In this example, the property does not match the more general index, and the type-checker gives an error: - -```TypeScript -interface Dictionary { - [index: string]: string; - length: number; // error, the type of 'length' is not a subtype of the indexer -} -``` - -# Class Types - -## Implementing an interface - -One of the most common uses of interfaces in languages like C# and Java, that of explicitly enforcing that as class meets a particular contract, is also possible in TypeScript. - -```TypeScript -interface ClockInterface { - currentTime: Date; -} - -class Clock implements ClockInterface { - currentTime: Date; - constructor(h: number, m: number) { } -} -``` - -You can also describe methods in an interface that are implemented in the class, as we do with 'setTime' in the below example: - -```TypeScript -interface ClockInterface { - currentTime: Date; - setTime(d: Date); -} - -class Clock implements ClockInterface { - currentTime: Date; - setTime(d: Date) { - this.currentTime = d; - } - constructor(h: number, m: number) { } -} -``` - -Interfaces describe the public side of the class, rather than both the public and private side. This prohibits you from using them to check that a class also has particular types for the private side of the class instance. - -## Difference between static/instance side of class -When working with classes and interfaces, it helps to keep in mind that a class has _two_ types: the type of the static side and the type of the instance side. You may notice that if you create an interface with a construct signature and try to create a class that implements this interface you get an error: - -```TypeScript -interface ClockInterface { - new (hour: number, minute: number); -} - -class Clock implements ClockInterface { - currentTime: Date; - constructor(h: number, m: number) { } -} -``` - -This is because when a class implements an interface, only the instance side of the class is checked. Since the constructor sits in the static side, it is not included in this check. - -Instead, you would need to work with the 'static' side of the class directly. In this example, we work with the class directly: - -```TypeScript -interface ClockStatic { - new (hour: number, minute: number); -} - -class Clock { - currentTime: Date; - constructor(h: number, m: number) { } -} - -var cs: ClockStatic = Clock; -var newClock = new cs(7, 30); -``` - -# Extending Interfaces - -Like classes, interfaces can extend each other. This handles the task of copying the members of one interface into another, allowing you more freedom in how you separate your interfaces into reusable components. - -```TypeScript -interface Shape { - color: string; -} - -interface Square extends Shape { - sideLength: number; -} - -var square = {}; -square.color = "blue"; -square.sideLength = 10; -``` - -An interface can extend multiple interfaces, creating a combination of all of the interfaces. - -```TypeScript -interface Shape { - color: string; -} - -interface PenStroke { - penWidth: number; -} - -interface Square extends Shape, PenStroke { - sideLength: number; -} - -var square = {}; -square.color = "blue"; -square.sideLength = 10; -square.penWidth = 5.0; -``` - -# Hybrid Types - -As we mentioned earlier, interfaces can describe the rich types present in real world JavaScript. Because of JavaScript's dynamic and flexible nature, you may occasionally encounter an object that works as a combination of some of the types described above. - -One such example is an object that acts as both a function and an object, with additional properties: - -```TypeScript -interface Counter { - (start: number): string; - interval: number; - reset(): void; -} - -var c: Counter; -c(10); -c.reset(); -c.interval = 5.0; -``` - -When interacting with 3rd-party JavaScript, you may need to use patterns like the above to fully-describe the shape of the type. \ No newline at end of file diff --git a/Mixins.md b/Mixins.md deleted file mode 100644 index d75cbd28..00000000 --- a/Mixins.md +++ /dev/null @@ -1,130 +0,0 @@ -> # Hey, this page is out of date! -> For a more up to date guide, check out [Mixins](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Mixins.md) at our Handbook repo page. - -# Introduction - -Along with traditional OO hierarchies, another popular way of building up classes from reusable components is to build them by combining simpler partial classes. You may be familiar with the idea of mixins or traits for languages like Scala, and the pattern has also reached some popularity in the JavaScript community. - -# Mixin sample - -In the code below, we show how you can model mixins in TypeScript. After the code, we'll break down how it works. - -```TypeScript -// Disposable Mixin -class Disposable { - isDisposed: boolean; - dispose() { - this.isDisposed = true; - } - -} - -// Activatable Mixin -class Activatable { - isActive: boolean; - activate() { - this.isActive = true; - } - deactivate() { - this.isActive = false; - } -} - -class SmartObject implements Disposable, Activatable { - constructor() { - setInterval(() => console.log(this.isActive + " : " + this.isDisposed), 500); - } - - interact() { - this.activate(); - } - - // Disposable - isDisposed: boolean = false; - dispose: () => void; - // Activatable - isActive: boolean = false; - activate: () => void; - deactivate: () => void; -} -applyMixins(SmartObject, [Disposable, Activatable]) - -var smartObj = new SmartObject(); -setTimeout(() => smartObj.interact(), 1000); - -//////////////////////////////////////// -// In your runtime library somewhere -//////////////////////////////////////// - -function applyMixins(derivedCtor: any, baseCtors: any[]) { - baseCtors.forEach(baseCtor => { - Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => { - derivedCtor.prototype[name] = baseCtor.prototype[name]; - }) - }); -} -``` - -# Understanding the sample - -The code sample starts with the two classes that will act is our mixins. You can see each one is focused on a particular activity or capability. We'll later mix these together to form a new class from both capabilities. - -```TypeScript -// Disposable Mixin -class Disposable { - isDisposed: boolean; - dispose() { - this.isDisposed = true; - } - -} - -// Activatable Mixin -class Activatable { - isActive: boolean; - activate() { - this.isActive = true; - } - deactivate() { - this.isActive = false; - } -} -``` - -Next, we'll create the class that will handle the combination of the two mixins. Let's look at this in more detail to see how it does this: - -```TypeScript -class SmartObject implements Disposable, Activatable { -``` - -The first thing you may notice in the above is that instead of using 'extends', we use 'implements'. This treats the classes as interfaces, and only uses the types behind Disposable and Activatable rather than the implementation. This means that we'll have to provide the implementation in class. Except, that's exactly what we want to avoid by using mixins. - -To satisfy this requirement, we create stand-in properties and their types for the members that will come from our mixins. This satisfies the compiler that these members will be available at runtime. This lets us still get the benefit of the mixins, albeit with a some bookkeeping overhead. - -```TypeScript -// Disposable -isDisposed: boolean = false; -dispose: () => void; -// Activatable -isActive: boolean = false; -activate: () => void; -deactivate: () => void; -``` - -Finally, we mix our mixins into the class, creating the full implementation. - -```TypeScript -applyMixins(SmartObject, [Disposable, Activatable]) -``` - -Lastly, we create a helper function that will do the mixing for us. This will run through the properties of each of the mixins and copy them over to the target of the mixins, filling out the stand-in properties with their implementations. - -```TypeScript -function applyMixins(derivedCtor: any, baseCtors: any[]) { - baseCtors.forEach(baseCtor => { - Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => { - derivedCtor.prototype[name] = baseCtor.prototype[name]; - }) - }); -} -``` \ No newline at end of file diff --git a/Modules.md b/Modules.md deleted file mode 100644 index b5d47c72..00000000 --- a/Modules.md +++ /dev/null @@ -1,498 +0,0 @@ -> # Hey, this page is out of date! -> For a more up to date guide, check out [Namespaces and Modules](https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Namespaces%20and%20Modules.md) at our Handbook repo page. - -# Introduction -This post outlines the various ways to organize your code using modules in TypeScript. We'll be covering internal and external modules and we'll discuss when each is appropriate and how to use them. We'll also go over some advanced topics of how to use external modules, and address some common pitfalls when using modules in TypeScript. - -## First steps -Let's start with the program we'll be using as our example throughout this page. We've written a small set of simplistic string validators, like you might use when checking a user's input on a form in a webpage or checking the format of an externally-provided data file. - -### Validators in a single file - -```TypeScript -interface StringValidator { - isAcceptable(s: string): boolean; -} - -var lettersRegexp = /^[A-Za-z]+$/; -var numberRegexp = /^[0-9]+$/; - -class LettersOnlyValidator implements StringValidator { - isAcceptable(s: string) { - return lettersRegexp.test(s); - } -} - -class ZipCodeValidator implements StringValidator { - isAcceptable(s: string) { - return s.length === 5 && numberRegexp.test(s); - } -} - -// Some samples to try -var strings = ['Hello', '98052', '101']; -// Validators to use -var validators: { [s: string]: StringValidator; } = {}; -validators['ZIP code'] = new ZipCodeValidator(); -validators['Letters only'] = new LettersOnlyValidator(); -// Show whether each string passed each validator -strings.forEach(s => { - for (var name in validators) { - console.log('"' + s + '" ' + (validators[name].isAcceptable(s) ? ' matches ' : ' does not match ') + name); - } -}); -``` - -### Adding Modularity -As we add more validators, we're going to want to have some kind of organization scheme so that we can keep track of our types and not worry about name collisions with other objects. Instead of putting lots of different names into the global namespace, let's wrap up our objects into a module. - -In this example, we've moved all the Validator-related types into a module called _Validation_. Because we want the interfaces and classes here to be visible outside the module, we preface them with _export_. Conversely, the variables _lettersRegexp_ and _numberRegexp_ are implementation details, so they are left unexported and will not be visible to code outside the module. In the test code at the bottom of the file, we now need to qualify the names of the types when used outside the module, e.g. _Validation.LettersOnlyValidator_. - -### Modularized Validators - -```TypeScript -module Validation { - export interface StringValidator { - isAcceptable(s: string): boolean; - } - - var lettersRegexp = /^[A-Za-z]+$/; - var numberRegexp = /^[0-9]+$/; - - export class LettersOnlyValidator implements StringValidator { - isAcceptable(s: string) { - return lettersRegexp.test(s); - } - } - - export class ZipCodeValidator implements StringValidator { - isAcceptable(s: string) { - return s.length === 5 && numberRegexp.test(s); - } - } -} - -// Some samples to try -var strings = ['Hello', '98052', '101']; -// Validators to use -var validators: { [s: string]: Validation.StringValidator; } = {}; -validators['ZIP code'] = new Validation.ZipCodeValidator(); -validators['Letters only'] = new Validation.LettersOnlyValidator(); -// Show whether each string passed each validator -strings.forEach(s => { - for (var name in validators) { - console.log('"' + s + '" ' + (validators[name].isAcceptable(s) ? ' matches ' : ' does not match ') + name); - } -}); -``` - -# Splitting Across Files -As our application grows, we'll want to split the code across multiple files to make it easier to maintain. - -Here, we've split our Validation module across many files. Even though the files are separate, they can each contribute to the same module and can be consumed as if they were all defined in one place. Because there are dependencies between files, we've added reference tags to tell the compiler about the relationships between the files. Our test code is otherwise unchanged. - -## Multi-file internal modules -### Validation.ts -```TypeScript -module Validation { - export interface StringValidator { - isAcceptable(s: string): boolean; - } -} -``` -### LettersOnlyValidator.ts -```TypeScript -/// -module Validation { - var lettersRegexp = /^[A-Za-z]+$/; - export class LettersOnlyValidator implements StringValidator { - isAcceptable(s: string) { - return lettersRegexp.test(s); - } - } -} -``` - -### ZipCodeValidator.ts -```TypeScript -/// -module Validation { - var numberRegexp = /^[0-9]+$/; - export class ZipCodeValidator implements StringValidator { - isAcceptable(s: string) { - return s.length === 5 && numberRegexp.test(s); - } - } -} -``` - -### Test.ts -```TypeScript -/// -/// -/// - -// Some samples to try -var strings = ['Hello', '98052', '101']; -// Validators to use -var validators: { [s: string]: Validation.StringValidator; } = {}; -validators['ZIP code'] = new Validation.ZipCodeValidator(); -validators['Letters only'] = new Validation.LettersOnlyValidator(); -// Show whether each string passed each validator -strings.forEach(s => { - for (var name in validators) { - console.log('"' + s + '" ' + (validators[name].isAcceptable(s) ? ' matches ' : ' does not match ') + name); - } -}); -``` - -Once there are multiple files involved, we'll need to make sure all of the compiled code gets loaded. There are two ways of doing this. - -First, we can use concatenated output using the _--out_ flag to compile all of the input files into a single JavaScript output file: - -```Shell -tsc --out sample.js Test.ts -``` - -The compiler will automatically order the output file based on the reference tags present in the files. You can also specify each file individually: - -```Shell -tsc --out sample.js Validation.ts LettersOnlyValidator.ts ZipCodeValidator.ts Test.ts -``` - -Alternatively, we can use per-file compilation (the default) to emit one JavaScript file for each input file. If multiple JS files get produced, we'll need to use _