I have searched through countless solutions to a similar issue, but none seem to work for me. I am attempting to utilize an npm package that lacks TypeScript type definitions, so I decided to create my own .d.ts file. However, every time I try, I encounter the following error:
Could not find a declaration file for module 'aws-elasticsearch-connector'.
Here is my file structure:
https://i.sstatic.net/s1JGt.png
tsconfig.json
{
"include": [
"src"
],
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
}
}
A snippet from aws-elasticsearch-connector.d.ts:
declare module 'aws-elasticsearch-connector';
And here's a portion of index.ts:
import * as AWS from 'aws-sdk'
import { Client } from '@elastic/elasticsearch'
import { createAwsElasticsearchConnector } from 'aws-elasticsearch-connector'