I have a project which has this structure:
project/
├── package.config
├── node_modules/
│ ├── interactjs/
│ ├── ├── index.d.ts
├── src/
│ ├── browser/
│ | ├── tsconfig.json
│ | ├── index.ts
I have the following ./package.json
:
{
...
"dependencies": {
"interactjs": "1.3.4"
},
"devDependencies": {
"typescript": "3.2.2"
}
}
My ./src/browser/tsconfig.json
is:
{
"compilerOptions": {
"target": "es5",
"module": "none",
"declaration": true,
"strict": true,
"strictNullChecks": false,
"outDir": "./out"
},
"typeRoots": [
"../../node_modules",
"../../node_modules/@types",
"../definitions"
],
"include": [
"./**/*"
]
}
As you can see I am including also folder definitions
as there are some manual definitions I want to include in all Typescript files of my project.
Problem
The following fails compilation:
const p : interact.Position = { x: 1, y: 2 };
With error:
index.ts:9:11 - error TS2503: Cannot find namespace 'interact'.
9 const s : interact.Position = { x: 1, y: 2 };
~~~~~~~~
interact
is not found even though in node_modules/interactjs
file index.d.ts
is present with all the definitions.
What is the problem?
project/node_modules/inderactjs/index.d.ts
? – Edholmproject/node_modules/interactjs/dist/interact.d.ts
. – Edholm