官术网_书友最值得收藏!

Setting up the IDE

To start writing code in TypeScript, we first need to install the compiler. The compiler is available as a standalone package through Node.js, Visual Studio tooling that Microsoft provides, or you can directly download the compiler's source code. Throughout this text we will be using Visual Studio 2013 as our interactive development environment (IDE). Visual Studio 2013 provides native support for TypeScript with the release of Update 2. For Visual Studio 2012, Microsoft provides an extension that can be installed from the TypeScript home page ( number of code editors that have support for it has grown including Eclipse (http://www.jetbrains.com/webstorm/) and Notepad++ (https://github.com/hansrwindhoff/nppPluginTypescript).

The TypeScript compiler, as with a number of modern languages, is written in TypeScript, which means it will compile to plain JavaScript and run in any JavaScript host. With Microsoft's tools installed, you can access the TypeScript compiler directly from the command line and generate JavaScript immediately. The following screenshot shows a list of the available compiler options and what they do. We will look at each of these options more thoroughly later on but for now you can see that the compiler, although very new, already has a very robust feature set

As you can see the list of options is fairly extensive so far and will undoubtedly become richer as the language develops. TypeScript 1.0, which will be the version of the language used in this text, provides parameters for everything from specifying the output file to warnings based on code rules. We will discuss all of these options later on, but for now all you need to know is that you can compile your TypeScript code by passing the compiler the path of the file you want to compile. When we begin to build more complicated applications the Visual Studio integrations will provide an easy way for you to set compiler options for all TypeScript files included in your projects.

主站蜘蛛池模板: 林周县| 大洼县| 江油市| 屏南县| 沾化县| 宝丰县| 赣州市| 泗阳县| 内江市| 二连浩特市| 客服| 越西县| 大渡口区| 德州市| 常熟市| 金塔县| 长兴县| 汉阴县| 舒兰市| 滨海县| 长寿区| 阳东县| 石嘴山市| 乳山市| 崇阳县| 巫溪县| 沙坪坝区| 白水县| 吉木萨尔县| 罗田县| 通榆县| 南康市| 高碑店市| 漾濞| 辽中县| 嘉义市| 虎林市| 朝阳区| 玉门市| 广元市| 新乐市|