title: Typescript Global Variable across Files
body: <p>I created a variable in a .ts file that has no module or class. It mostly looks just like a plain JavaScript file. I want this variable to accessible in another .ts file inside of a class that is inside of a variable.</p>
  
  <p>So for example I have:</p>
  
  <p><strong>foo.ts</strong></p>
  
  <pre><code>var foo = "some stuff";
  </code></pre>
  
  <p><strong>bar.ts</strong></p>
  
  <pre><code>module Bar {
      export class BarClass {
          function getFoo() {
               return foo;
          }
      }
  }
  </code></pre>
  
  <p>I'm not sure this is the best way to do it. I've tried using the window.bar global but that doesn't seem to work. I'm new to TypeScript jumping into a larger codebase so please let me know if you need any further clarification on anything.</p>
  
  <p>Thanks!</p>