I get the following message in VSCode.:
Could not find a declaration file for module
'LIBRARY'
.'...node_modules/LIBRARY/lib/FILENAME.js'
implicitly has an'any'
type. Trynpm install @types/LIBRARY
if it exists or add a new declaration (.d.ts
) file containingdeclare module 'LIBRARY';
ts(7016)
I have declared a (.d.ts) file in the typings
folder in node_modules/LIBRARY/
.
Also I use LocalForage as a dependency in my LIBRARY
. LocalForage brings their own typings in node_modules/localforage/typings/ localforage.d.ts
, which can also not be found.
I tried the following in the tsconfig.json
:
{
.
.
.
"types": [
"**/*.d.ts",
"./node_modules/localforage/typings/localforage.d.ts",
"./node_modules/LIBRARY/typings/FILENAME.d.ts",
],
"typeRoots": [
"./node_modules/*/typings",
"./node_modules/**/typings",
"./node_modules/@types"
],
.
.
.
}
but it does not work.
How can I setup it in the tsconfig
file, so that Typescript can find it?