I'm declaring a module in typescript:
declare module 'myweb' {
export default class MyWeb {
constructor(url: string);
}
}
When I import it by import MyWeb from 'myweb'; I get error TypeError: myweb_1.default is not a constructor.
It gets transpiled to:
const myweb_1 = require("myweb");
...
new myweb_1.default(url);
It seems right to me.
There are also other exported elements in module so I can't use export =
Any ideas? Thanks.
EDIT:
The javascript itself is a library I can't change, but the code is:
var MyWeb = function MyWeb() {
var _this = this;
processParams(this, arguments);
}
module.exports = MyWeb;
mywebtoo. That would help us find the type declaration to match it.MyWeb.module.exports = MyWebmodule.exports = MyWeb, the module is exporting one and only one element. What makes you think there are other exported elements in the module?