I am using editorjs in my project and there are no typescript files in my project.
Could not find a declaration file for module '@editorjs/image'. 'node_modules/@editorjs/image/dist/bundle.js' implicitly has an 'any' type.
Try npm i --save-dev @types/editorjs__image
if it exists or add a new declaration (.d.ts) file containing declare module '@editorjs/image';
ts(7016)
No quick fixes are available. The typescript package is not available and when I am creating .d.ts file in the project
declare module "@editorjs/image"
but it is not referring to the editorjs/image package for the usage.
Asked
Active
Viewed 4,336 times
3

ash
- 31
- 1
- 3
-
Have you tried running this command: npm i --save-dev @types/editorjs__image – Hamza Khan Feb 03 '22 at 06:24
-
2The npm package is not there on the typescript website. – ash Feb 08 '22 at 06:51
1 Answers
1
The problem is that the .d.ts
file you've created in the project should also be listed as a part of your project in your tsconfig.json
:
"include": [
"**/*.ts",
"**/*.tsx",
"global.d.ts" // << specify your file here
],

Kostiantyn Ko
- 2,087
- 1
- 18
- 16
-
There is no tsconfig file in the project currently. I am using only js in the project. – ash Feb 08 '22 at 06:51
-
Well, then maybe create one, as long as you want to use TS syntax of course – Kostiantyn Ko Feb 08 '22 at 10:45