I start to use typescript in my frontend and backend (node.js), and I notice I've duplicated type definitions like the API response. What's the best way I can share it when we have 2 teams working on the product?
Asked
Active
Viewed 1,219 times
2 Answers
1
One option would be to put all of the shared types into its own .ts file or a private repository shared among the teams, so that both can import it.
The repository route is probably the more maintainable solution, since it'll allow for multiple files (very useful in large projects) and is easier with its own source control.

CertainPerformance
- 356,069
- 52
- 309
- 320