I Hey, i am not an expert when it comes to typescript and i am quite stuck for some hours now ๐ฆ I am trying to use the types defined in a NPM package youtube-dl-exec which is under node_modules/youtube-dl-exec/src/index.d.ts but i simply do not know how to do so. The following is my configuration file:
{
"extends": "./node_modules/gts/tsconfig-google.json",
"compilerOptions": {
"module": "ES2020",
"moduleResolution": "node",
"rootDir": "./src",
"outDir": "build",
"lib": ["es2019", "es6", "dom"],
"types": ["reflect-metadata"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
],
"ts-node": {
"esm": true,
"files": true
}
}
I have already tried to:
- Add the relative path to the index.d.ts file of the package into includes
- Add the package to types
- Add the package to typeRoots
No matter what i do, my VS Code cant resolve the type and my code does not work. Is this even possible to just simply import that types outside of @types?
I would be very grateful for a hint into the right direction or could show me an example on importing an .d.ts from an arbitrary location.
Thanks!