I have come across much literature discussing the purpose of declaration .d.ts
files, but I haven't found much information on how to actually implement them. It seems that these files can be automatically generated using the typescript compiler.
This has led me to a few questions:
When is it appropriate to manually write a
.d.ts
file, and when should they be autogenerated?What occurs if I create my own
.d.ts
files and also let the compiler generate them?Should I create a
.d.ts
file for every.ts
file, or only for what will be exposed as part of the API in my library?
Any insights would be appreciated, thank you!