Member-only story
Learning TypeScript 06 — Declaration files
At this point, we have talked about a lot of different things related to TypeScript.
But now, we need to understand how to be able to work with JavaScript libraries with our TypeScript code.
And that is really easy thanks to the ‘declaration files’ because these files tell to TypeScripthow the libraries are made and how are their structures.
But can I work without declaration files?
Sure, you can. This is an example of a code that is loading an external library.
In the most of the cases if you load the library like import * as NAME from 'path'
it will work but are not going to be able to know anything from the library.
If you have problems you can try something like this.
But yes, this is ugly.