Last Year I wrote a blog post about TypeScript and jQuery. I introduced TSD, a manager for TypeScript definition files. TSD, or Typings as TSD is deprecated now, contains nearly thousand definition files. But what if you want to use your own library or a library that has no definition file yet? You could write it yourself. It's not that hard. I will show you an really simple example.
I've copied that file named
public folder and referenced it in the main HTML file. Also I created a folder
own in the folder
typings and created the file
index.d.ts and you're ready.
As you may see, exporting the function is very easy. To create a object of type
void. I also declared a namespace for
Person. This is not indispensable, but it's necessary for having IntelliSense in WebStorm.