title: TypeScript: type alias vs string-based enum
body: <p>So, I've got:</p>
  
  <pre class="lang-js prettyprint-override"><code>interface Foo {
    type: FooType;
  }
  </code></pre>
  
  <p>Which one is better to be used as <code>FooType</code> here:</p>
  
  <p><strong>Type alias</strong>?</p>
  
  <pre class="lang-js prettyprint-override"><code>type FooType = 'BAR' | 'BAZ';
  </code></pre>
  
  <p>Or <strong>string-based enum</strong>?</p>
  
  <pre class="lang-js prettyprint-override"><code>enum FooType {
    BAR = 'BAR',
    BAZ = 'BAZ'
  }
  </code></pre>
  
  <p>What are the pros and cons of the two?</p>