DEV Community

Discussion on: Advanced TypeScript series. Would you be interested?

 
adam_cyclones profile image
Adam Crockett 🌀

Ah ... Of course, I wasn't thinking about this context where a library was not originally authored in Typescript (but I was drunk so you can let me off). I'm sure there is tooling to introspect JavaScript libs and generate .d.ts files anyway. When there's a will there's a way.

Thread Thread
 
macsikora profile image
Pragmatic Maciej
Thread Thread
 
adam_cyclones profile image
Adam Crockett 🌀

Thank you Maciej and thank you Microsoft.

So you see a definition file is not desirable to hand write because, it's bad enough maintaing code that actually do something, can you imagine refactoring this every time you make a change as well, people would rage quit typescript. I used to do it by hand then decide I cba. But there we go, you can and should generate as much as possible.