Currently, I am utilizing an npm package called "foo" for my project development. However, I want to link this package with a local TypeScript definitions file that is committed along with the project files. My intention is not to release this definitions file as an npm package since it's incomplete and only covers the parts of the library that I actually use.
I have attempted to solve this issue by:
Including the following in tsconfig.json
"typeRoots": [
"./node_modules/@types",
"./src/types"
],
I have also placed the definition file in ./src/types/foo/index.d.ts
. Unfortunately, neither VSCode nor the TypeScript webpack-loader are recognizing the imports from 'foo' with the exports specified in the definition file.
What would be the correct approach to address this situation?