TypeScript

Basically, TypeScript is a superset of javascript. Apart from being a typed scripting language, it let’s me write javascript like C#. It comes with a compiler that compiles typescript code to javascript code. Create classes, interfaces, namespaces (called modules), Generics bit like C# and has in-built support for NodeJS (by support, I mean intellisense, syntax check etc.) Play here first and then you can download TypeScript for Visual studio 2012 which has typescript editor and compiler.

To compile, turn on the setting in VS2012 that enables compilation of typescript code to javascript code ‘on SAVE’. Visual Studio 2013 has Typescript installed by default.

It can also support other javascript libraries like knockout, angularJS and many more, but you need their corresponding typescript definition files (TDF) which can be found here. If you struggle to find TDF for any external library, you can still use it’s code in typescript and the code will be compiled as it is to plain javascript code.

Trackbacks

Leave a Comment

Your email address will not be published. Required fields are marked *