I have been attempting to utilize the type definitions from the callbag library. Unlike other libraries, callbag declares its type definition file within its package.json and is not included in DefinitelyTyped. However, when I try to import the library, I encounter the following error:
Cannot find module 'callbag'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
This is how I am importing it:
import type { Sink } from 'callbag';
Here is my tsconfig.json
:
{
"compilerOptions": {
"module": "es6",
"noEmitOnError": true,
"outDir": "./dist",
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "es5"
},
"include": ["./src/**/*"]
}
I also attempted adding
"types": ["callbag"]
to the tsconfig.json, but unfortunately, that did not resolve the issue.
How can I make sure that typescript recognizes the types for this particular library?