Learning TypeScript 2.x
上QQ阅读APP看书,第一时间看更新

TypeScript components

The TypeScript language has three main internal layers. Each of these layers is, in turn, divided into sublayers or components. In the following diagram, we can see the three layers (three different shades of gray) and each of their internal components (boxes):

In the preceding diagram, the acronym VS refers to Microsoft's Visual Studio, which is the official family of integrated development environments ( IDEs) for all Microsoft products (including TypeScript). We will learn more about this and the other IDEs in Chapter 9, Automating Your Development Workflow.

Each of these main layers has a different purpose:

  • Language: Features the TypeScript language elements.
  • Compiler Performs the parsing, type checking, and transformation of your TypeScript code to JavaScript code.
  • Language services: Generates information that helps editors and other tools provide better assistance features, such as IntelliSense or automated refactoring.
  • IDE integration (VS Shim): The developers of the IDEs and text editors must perform some integration work to take advantage of the TypeScript features. TypeScript was designed to facilitate the development of tools that help to increase the productivity of JavaScript developers. Because of these efforts, integrating TypeScript with an IDE is not a complicated task. A proof of this is that the most popular IDEs these days include good TypeScript support.
In other books and online resources, you may find references to the term transpiler instead of compiler. A transpiler is a type of compiler that takes the source code of a programming language as its input and outputs the source code into another programming language with a similar level of abstraction.

We will learn more about the TypeScript language services and the TypeScript compiler in Chapter 15, Working with the TypeScript Compiler and the Language Services.