Things which I already know:
But what I want to know is
I tried with point 2 but was not able to take it's reference. Can any one tell me that How can I import third-party typescript plugins and import them in my angular2 components. What is best practice?
Secondly, what is the use of typings folder?
There are many ways to do the thing. However the modern way is using types from the
In order to do that (if the library itself does not provide the types like Angular does) you need to install the typescript definition files:
npm install @types/mylibrarytoimport --save-dev
This will take the type definitions from https://github.com/DefinitelyTyped/DefinitelyTyped. Now the interesting part: how to use it in your project. According to the docs you don't need to do anything else: it just works.
Before this way became possible there was a
typings library which tried to fix the problem until they realised they implement a second
npm, so they just moved to the existing one. Luckily NPM added support of scoped packages which made it possible.
typings there was no real way to get the type definitions automatically, so everybody was forced to download and track the changes manually.