Was playing around with Ts and got stuck at this
"use strict";
declare const require: any;
const EventEmitter : any = require('events').EventEmitter;
class Foo extends EventEmitter{ //*error* Type 'any' is not a constructor function type.
constructor() {
super();
}
}
I also tried to assign EventEmitter
to an interface type of mine, which gave the same error.
How can I extend a class, with commonjs modules using Typescript?
Thank you