In this section, we are going to talk about Modules. Modules, keep the code separated. In many ways, it help users to keep the code neat and clean. It’s something like we are going to keep different unit of works in different placeholders or you say in different files. By separating the code out, it enhances the productivity immensely, like test-ability and re-usability enhances immensely. This way, your code not only appears robust, but it also follows good pattern like code-of-separation and solid. Now, we explicitly declare module with the name module itself. From C# perspective, you can also think modules as equivalent to namespaces.
In this section, we will see how to use third party libraries like jquery or angular or anything with TypeScript. TypeScript, provides this flexibility to use any third party libraries on the top of your TS file, using some interface. And, this interface is called Definitely Typed in TypeScript. Here, is the URL of Definitely Typedhttp://definitelytyped.org/. Once you open the same, it will open the following page.
In this section, we will delve further and see how to work with Interfaces using TypeScript. Below, I have created a very simple and straightforward interface and class. Here, class Implements the interface.
In this section, we are going to look creation and implementation of classes in TypeScript. TypeScript provides built in support for class. I have already discussed in the last post, if you are coming from the background C# or Java, then you must be familiar with class. Basically, a class is container whose role is to contain code means making a reusable stuff, such that same can be used time and again.
In this section, we will continue from the last segment and delve further in TypeScript. In this section, we will look how to use interfaces with TypeScript. If you are coming from system’s language background say C# or JAVA, you must be knowing different OOPs terminology and Interfaces are one of the key concepts for enforcing constraints on implementing classes. Let us go ahead and jump at demos.
Now, if I hover on the same, it will show the type any.
In this section, we will continue from the last place and explore more into TypeScript. Here, we will be starting with basics of TypeScript, means very much around the syntax areas. Let us look at few samples around the same.
Now, if I hover on the x variable, it will show of type number as shown below.
This is the continuation from the last segment. In this case, we will first gets started with Visual Studio Tooling support for Typescript. In order to download the same, you need to download from http://www.typescriptlang.org/#Download. Once you open the page, you will see the download options as shown below.