title: Typescript import - One class per file convention
body: <p>I have just started with Typescript for a front-end web project. My goal is to use a OOP approach. So my convention is one class by file (named from the class it contains).</p>
  
  <p>Consider this example: </p>
  
  <pre><code>//Car.ts
  export default class Car {
      public startEngine (): void {
          console.log('vroom!');        
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>//RaceCar.ts
  import Car from './Car';
  
  export default class RaceCar extends Car {
      public startEngine (): void {
          console.log('!!VROOOOOMM!!');        
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>//index.ts 
  import RaceCar from './RaceCar';
  import Car from './RaceCar';
  
  const car:Car = new RaceCar();
  
  car.startEngine();
  </code></pre>
  
  <p>This code works fine but I have 2 questions:</p>
  
  <ul>
  <li>When I use the convention "one class per file" (with default export) it is really annoying to write <code>import Car from './Car';</code>. Is there a short way to do this? Like a macro or something? I have tried <code>import './Car';</code> but of course this does not import <code>Car</code> symbol...</li>
  <li>Another annoying thing is to import Car and RaceCar in index.ts. Is there a way to import only RaceCar that already knows the Race class?</li>
  </ul>
  
  <p>In other words I am looking for a way to do something like a C++ include.</p>