title: How can I have a global extendable object holding instances with type information in typescript?
body: <p>I am porting a JavaScript application to TypeScript and the app makes use of a global container variable for common functions and variables. This variable, let's call it <code>Engine</code>, is in the global scope and contains stuff like assert or log functions, to avoid that you have to import those for every single file.</p>
  
  <p>Also, <code>Engine</code> contains important instances, like a NetworkManager, which are used from everywhere. Those instances get added to <code>Engine</code> dynamically during the application initialization by different classes.</p>
  
  <p>I am less concerned about the scoping issues of having a global variable, but more of the approach in general and how to modify this object from different modules without having a full type declaration in one spot.</p>
  
  <p>What is the best practice for TypeScript here?</p>