I did npm install frappe-gantt and npm install --save @types/frappe-gantt, but I still get the following error:
1 import Gantt from 'frappe-gantt';
~~~~~
node_modules/@types/frappe-gantt/index.d.ts:1:1
1 export = Gantt;
~~~~~~~~~~~~~~~
This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.```
Here is my tsconfig.json:
```json
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"typeRoots": [
"./node_modules/@types"
],
},
"include": [
"src"
]
}```
Here is the simple test.ts file I am trying to run:
```ts
import Gantt from 'frappe-gantt';
// Assuming you have a target element in your HTML where the Gantt chart should be rendered
const wrapper = document.createElement('div'); // Create a div for demonstration purposes
// Example tasks array with 'dependencies' property
const tasks = [
{
id: 'Task 1',
name: 'Task 1',
start: '2024-08-20',
end: '2024-08-25',
progress: 20,
dependencies: '', // No dependencies
},
{
id: 'Task 2',
name: 'Task 2',
start: '2024-08-26',
end: '2024-08-30',
progress: 50,
dependencies: 'Task 1', // Depends on Task 1
},
// Add more tasks as needed
];
// Initialize the Gantt chart
const gantt = new Gantt(wrapper, tasks);
// Log a simple message to confirm execution
console.log('Gantt chart initialized.');