title: TypeScript: Create an union type of strings from a certain type
body: <p>I have a type <code>IconName</code> that looks like this:</p>
  <pre class="lang-js prettyprint-override"><code>type IconName = 'cars' | 'mars' | 'truck' | 'warning'
  </code></pre>
  <p>I want then to create another type <code>VehicleIconName</code> which contains all icons name related to a vehicle:</p>
  <pre class="lang-js prettyprint-override"><code>type VehicleIconName = 'cars' | 'truck'
  </code></pre>
  <p>But how can I tell to TypeScript that each strings in <code>VehicleIconName</code> have to be of type <code>IconName</code> too?</p>
  <p>So that I couldn't write this:</p>
  <pre class="lang-js prettyprint-override"><code>type VehicleIconName = 'cars' | 'truck' | 'invalidIconName'
  </code></pre>