I've got private repository with components which are shared through other projects. This repository is fully written in javascript (Vue.js). I would like to add types definitions for those, who are using typescript. This shared repository doesn't have root file, all components are imported from their files (e.g. import Button from 'shared/src/components/button'. How can I include the types declarations in the shared repository, to use it in other applications? I tried to add shared/src/components/button/index.d.ts declaration file and add node_modules/shared to typeRoots in tsconfig.json, but it doesn't work.
import Button from 'shared/src/components/button'
shared/src/components/button/index.d.ts
node_modules/shared
typeRoots
tsconfig.json
2.1m questions
2.1m answers
60 comments
57.0k users