title: How to add my own typescript classes in Electron project
body: <p>I'm creating a hello world project in Electron and found out I can use Typescript for the Main process, <a href="https://electronjs.org/blog/typescript" rel="nofollow noreferrer">https://electronjs.org/blog/typescript</a>.</p>
  
  <p>It says to use Typescript change the file extension from index.js to index.ts and then update the package.json to point to the new script:</p>
  
  <pre><code>{
    "name": "electrontypescript",
    "version": "1.0.0",
    "description": "Typescript and Electron",
    "main": "index.ts",
    "scripts": {
      "start": "electron ."
    },
    "devDependencies": {
      "electron": "^5.0.1"
    },
    "dependencies": {
      "lodash": "^4.17.11"
    }
  }
  </code></pre>
  
  <p>It works but when I went to add my own class it throws errors. </p>
  
  <p>Top of index.ts: </p>
  
  <pre><code>const { TypeHouse } = require ("./TypeHouse");
  </code></pre>
  
  <p>TypeHouse.ts: </p>
  
  <pre><code>function test() {
  
  }
  
  export class Cat {
  
  }
  
  export class TypeHouse {
     public status: String = "ready";
     private _output: String = "";
     readonly startTime = Date.now();
     private running: Boolean = false;
  
     constructor(private _message: String, private _prompt: String) {
         this.setStatus(_message);
     }
  
     async execute(): Promise&lt;void&gt; {
         try {
             //await CommandExecutor.execute(this);
         } catch (exception) {
             this.handleError(exception);
         } finally {
             //this.emit("end");
         }
     }
  
     handleError(message: TypeHouse | string): void {
         this.setStatus("Status.Failed");
         if (message) {
            // 
         }
     }
  
     isRunning(): boolean {
         return this.running !== false;
     }
  
     public setStatus(value: String) {
         this._output = value;
     }
  }
  
  module.exports = {TypeHouse, Cat};
  </code></pre>
  
  <p>Package.json: </p>
  
  <pre><code>{
    "name": "electron-app",
    "version": "1.0.0",
    "description": "Electron",
    "main": "index.js",
    "scripts": {
      "start": "electron ."
    },
    "devDependencies": {
      "electron": "^5.0.1",
      "typescript": "^3.5.1"
    },
    "dependencies": {
      "lodash": "^4.17.11"
    }
  }
  </code></pre>
  
  <p>Error message: </p>
  
  <blockquote>
    <p>App threw an error during load Error: Cannot find module './TypeHouse'
    Require stack:
    - /Users/projects/ElectronApp/index.ts
    - /Users/projects/ElectronApp/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js</p>
  </blockquote>
  
  <p>I'm using Visual Studio Code if it matters (it throws the error in the console). </p>