Find Us

TypeScript, I choose you.

TypeScript is a free and open source programming language developed and maintained by Microsoft. It’s a superset of JavaScript, which essentially adds static typing and class-based objects. Anders Hejlsberg, C # designer and creator of Delphi and Turbo Pascal, has worked on developing TypeScript. Typescript can be used to develop JavaScript applications that will run on the client side or server (Node.js).

TypeScript extends JavaScript syntaxy’s, therefore any existent JavaScript code should run smoothly. It is suitable for big projects, which are translated to JavaScript original code through a TypeScript compiler.

TypeScript supports definition files containing information on existing JavaScript library types, similar to the C/C ++ header files that describe the file structure of existing objects. This allows other programs to use the values defined in the files as if they were statically typed TypeScript entities. There are headers for popular libraries such as jQuery, MongoDB and D3.js, and the basic modules of Node.js

TypeScript compiler is also written in TypeScript, compiled to JavaScript and with an Apache 2 License.

TypeScript is included as a first-level programming language in Microsoft Visual Studio 2013 Update 2 and higher versions, along with C# and other Microsoft languages. An official extension allows Visual Studio 2012 to support TypeScript as well.

Installation

Note: We can do a “tsc -w file.ts” so that it is “looking” at each file change and do not have to transpile by hand.

Let’s see an easy example of this language:

This was a brief example, we can do an even stronger programming in typing by specifying the types both in variables, parameters we receive, values that return the functions, etc.

Now let’s see what is the result in JS of the transpilacion (which is what we are going to link):

Personal opinion: I want to share with you a brief introduction to this language because I think TypeScript has a lot of potential as it includes JS standards, both ECMAScript5 and 6.

Being a strongly-typed language it allows a more organized, powerful and robust programming:

Here is a video of the official website with an even more detailed explanation: