Type declarations for a JS library
I want to use the functionality of a JS library in react TS. The lib doesn't have any type declarations. So, anybody know how do I create type declarations for that lib in my project?
And btw, TS tag not found
2 Replies
first thing worth checking is if there's an
@types/<libraryname>
package on npm
failing that, take a look at one of the existing @types
packages and copy that. It's going to be a lot of work though, depending on the size of the libraryI tried setting up type declarations inside the package in node modules.. it failed.. 😩.. I shall look into how the @TYpes works. I'm doing this for a small package so I hope not much work..