title: Importing TypeScript modules
body: <p>I am just trying to get my head around TypeScript,</p>
  
  <p>Say I have a module <code>animals.ts</code> like this:</p>
  
  <pre><code>export module Animals {
  
      export interface Animal {
          name(): void;
      }
  
      export class Elephant implements Animal {
  
          constructor() {
  
          } 
  
          public name() {
              console.log("Elephant");
          }
      }
  
      export class Horse implements Animal {
  
          constructor() {
  
          }
  
          public name() {
              console.log("Horse");
          }
      }
  }
  </code></pre>
  
  <p>And I want to use this module in another file <code>animals_panel.ts</code>:</p>
  
  <pre><code>import animals = require("animals")
  
  module AnimalPanel {
  
      var animal = new animals.Animals.Elephant();
      animal.name();
  }
  </code></pre>
  
  <ol>
  <li>It seems a bit weird to me that I have to use <code>animals.Animals.Elephant()</code>, I would have expected <code>Animals.Elephant()</code>. Am I doing something wrong or is this the correct behaviour?</li>
  <li>is it possible to import <code>import animals = require("animals")</code> inside the <code>AnimalPanel</code> module (I get errors when I try to do this)?</li>
  </ol>