I am using editorjs in react project with typescript. I am using EditorJS and noticed missing declaration file for module '@editorjs/image'.
Upon importing I noticed the following warning/error,
'node_modules/@editorjs/image/dist/bundle.js' implicitly has an 'any' type.
along with a suggestion,
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 types are missing for @editorjs/image
. I created a .d.ts
file in the project for @editorjs/image
module with the following declaration code,
declare module "@editorjs/image"
but it is not referring to the editorjs/image package for the usage.
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
],
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With