I'm encountering an issue with creating a declaration file for an existing module.
When using JavaScript, the module is imported using the following syntax:
var Library = require('thirdpartylibs');
var libInstance = new Library();
I have created a d.ts file named thirdpartylibs.d.ts
and added the following:
declare module 'thirdpartylibs'{
export class Library{}
}
In my index.ts
file:
import * as Library from 'thirdpartylibs'
let libInstance = new Library() // <--- error here
It seems like I should do
let libInstance = new Library.Library()
to make it work, but it will fail on the generated JS.
Can anyone help?