Unless you are using transpileOnly, generating declarations will not make a few second build become a few hours-- Typescript is already type checking your code.
I type everything I declare whether a primitive or not. My complex types like data structures, objects, and modules get typed as interfaces. I write them as I need them. I also have lint rules that check for missing type declarations.
Don’t over think any of this. None of this exists as an exercise in code masturbation. There are two immediate values to TS: warning on unintended type coercion and predictive rapid refactoring. So, just keep plan your software appropriately and keep everything simple.
So, my very best recommendation is to turn that frown upside down and measure things. This is called total cost of ownership (TOS). If the cost of manually writing types is less than the total cost of running builds in a week you then it is absolutely the most correct approach.
https://en.wikipedia.org/wiki/Total_cost_of_ownership
As far as fetishes go I try to avoid logical fallacies like you recommended for me: https://en.wikipedia.org/wiki/Argumentum_ad_populum
There are cases where folks write them by hand, but that's not what I had in mind when writing the article. I've rephrased that part a bit to hopefully make it less confusing.
The fact that there are developers out there that are willing to accept hour long compile times from the typescript compiler is disgusting. I’ve seen slow recursive types here and there, but you can analyze your slow types using tsc and fix them yourself.
I hope that slow typescript compiling is a niche issue for massively large/complex codebases and not a common problem.
Just think if you had to take a big JavaScript library, say the size and level of dynamism of jQuery, and manually write annotations for it yourself.
It would indeed take you hours to cover everything.
BTW, jQuery is pretty small. With good lint rules you could probably manually type everything without missing anything in less time than you think. Whatever time is spent doing this manually apparently is worth the cost savings comparing to long compile times if takes more than a few seconds. You only need to write the types once and then again on major refactors. If your builds just take seconds you can run them dozens of times a day. If your compile time is hours then whatever automation you imposed to write your types or d.ts files for you is entirely self-defeating as its costing you dramatically more than just doing it manually one time.
When you have a large project types are written as the code they describe are written, so its little more effort than typing on the keyboard in a separate file.
WTF. What kind of project would take long to compile from TS? Windows 11 (if it were TS)?
I had a long time personal project that was several megs of code with several hundred types/interfaces. It took 13 seconds to compile. If your application takes hours to compile and is less than a petabyte of source code you have some catastrophic mistakes in your approach.