As I work on adding a declaration file to a TypeScript package, I encounter some syntax that looks like this:
const Sequelize = require('Sequelize');
//...
class Application {
Sequelize = Sequelize;
}
To address this, I created a file named index.d.ts with the following content:
import * as Sequelize from 'sequelize'; // The @types/sequelize module exports a namespace
//...
interface Application{
Sequelize: Sequelize; // <---error TS2709: Cannot use namespace 'Sequelize' as a type.
}
I'm now facing the challenge of how to resolve this issue. Any suggestions?