title: Typescript: check if value is contained in type
body: <p>I have problem with defined types and checking if a value is contained in that type.</p>
  
  <p>Here is my example:</p>
  
  <p>these are the types:</p>
  
  <pre><code>export type Key = 'features' | 'special';
  
  export type TabTypes = 'info' | 'features' | 'special' | 'stars';
  </code></pre>
  
  <p>when the user changes a tab, it sends a string value from Type of TabTypes.</p>
  
  <pre><code>activeTabChanged(event: TabTypes) {
      this.activeTab: TabTypes = event;
      // it won't let me set the key here because key has a different type 
      // but the send event can be contained in type Key
      // how can I check if the send event from type TabTypes is contained in type Key
      this.key: Key = event;
  }
  </code></pre>
  
  <p>is there a typescript way to check if a sent value with a type can equal a value from a different type?</p>