title: Porting Javascript to Typescript
body: <p>I am trying to port a load of JS code I have inherited into Typescript. I have a file which is creating a module - <code>Bluetooth</code> - so goes through a whole load of functions adding them to the Bluetooth module, like this:</p>
  
  <pre><code>Bluetooth.xzy = function() {
  ...}
  
  //repeated various times
  
  module.exports = Bluetooth;
  </code></pre>
  
  <p>However, just in the file, there is a structure like this, it is mostly extending other classes. What is going on, I haven't seen this ()(); structure before. I am turning Bluetooth into a class, wuld the contents of this function be in a constructor?</p>
  
  <pre><code>(function () {
  // Whole load of normal function logic
  })();
  </code></pre>