title: How to declare group of strings as a type?
body: <p>I would like to enforce a group of strings as a strict type. Users should be only be able to pass in anything that matches a string in the group. How would I go about implementing this?</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>const types: Array&lt;string&gt; = [ 'text', 'password' ];
  
  interface IAbstractFormElement {
  
    value: string;
    type: Array&lt;types&gt;;
    required?: boolean;
    disabled?: boolean;
  
  }
  </code></pre>
  
  <p>Current error: <code>Cannot find name 'types'</code> which almost seems like a scope issue to me.</p>