title: Using a const as both an object and a type in typescript?
body: <p>We have a class that we need to use as both an object and as an interface. The class has a really long name, so we threw it in to a constant, but then strange things happened:</p>
  
  <pre><code>class MyClassWithAReallyLongNameThatIsAnnoyinToUse {
      constructor(public name: string) {}
      static className = "SomeThing:MyClassWithAReallyLongNameThatIsAnnoyinToUse";
  }
  
  // Convenience const to shorten
  const MyClassConst = MyClassWithAReallyLongNameThatIsAnnoyinToUse;
  
  let someFunction = (staticClassObject: Object, callback) =&gt;  {};
  
  // this errors, saying 'Cannot find name MyClassConst'
  someFunction(MyClassConst, (cmd: MyClassConst) =&gt; { /* do some thing */ });
  </code></pre>
  
  <p>However, if we throw in the <code>type</code> alias just below the <code>const</code>, it works:</p>
  
  <pre><code>class MyClassWithAReallyLongNameThatIsAnnoyinToUse {
      constructor(public name: string) {}
      static className = "SomeThing:MyClassWithAReallyLongNameThatIsAnnoyinToUse";
  }
  
  // Convenience const to shorten
  const MyClassConst = MyClassWithAReallyLongNameThatIsAnnoyinToUse;
  type MyClassConst = MyClassWithAReallyLongNameThatIsAnnoyinToUse;  // &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
  
  let someFunction = (staticClassObject: Object, callback) =&gt;  {};
  
  // this is fine
  someFunction(MyClassConst, (cmd: MyClassConst) =&gt; { /* do some thing */ });
  </code></pre>
  
  <p>But this seems really odd. Not only are we sort of mutating a const, but we're defining the same thing twice with the same assignment, just different keywords; and because using the plain long class name in each location of the const instead works perfectly fine. It only seems to raise an issue when the class is proxied through the const (or let or var, tried them as well). </p>
  
  <p>Is this just a quirk we have to live with, or is there something we can call on the const to get the type? Or is there another assignment we're missing?</p>