problem description
I recently used TypeScript in my project and found that I need to write a lot of type declarations. If a variable is passed between several files, the type should be declared everywhere, and a large number of type declarations lead to a great reduction in efficiency. How to balance the time of business code and type code? Where are the efficiency gains and benefits of writing types reflected?
the environmental background of the problems and what methods you have tried
I put all the types under the types folder. If a variable appears in different files, import the corresponding type directly to achieve reuse, but I still don"t know how to balance the time of writing business code and type code. Finally, in order to rush to work, I have to write any everywhere, feeling that I have lost the meaning of using ts.