title: TypeScript: TypeError: App is not a constructor
body: <p>I just started with typescript and trying to create an instance to the typescript class but I am unsuccessful.</p>
  
  <p>Below are my files</p>
  
  <p>App.ts</p>
  
  <pre><code>import { EventEmitter } from 'events';
  
  interface Emitter extends EventEmitter {
  
  }
  class App {
     constructor(protected app: Emitter){}
  }
  
  export default = App;
  </code></pre>
  
  <p>I am generating App.ts to <code>App.js</code> file using <code>tsc</code> command. The file got generated in dist folder as <code>App.js</code></p>
  
  <p>I have other file called Test.js</p>
  
  <p>In Test.js I am importing generated App.js file and created an instance to it like below but I get below error </p>
  
  <blockquote>
    <p>TypeError: App is not a constructor</p>
  </blockquote>
  
  <p>Test.js</p>
  
  <pre><code>const App = require("./dist/App);
  
  module.exports = function(app){
      const appInstance = new App(app)
  }
  </code></pre>
  
  <p>I don't understand why this is throwing such error though I have constructor available in App.ts file. </p>
  
  <blockquote>
    <p>Am I doing something wrong in App.ts file and that's why I get the above error?</p>
    
    <p>How can I resolve this issue?</p>
  </blockquote>