title: How do I ensure that the value of a property is one of the value in an pre-defined object?
body: <p>I am using React with TypeScript and would like to have to make sure the state type be limited to the values in an object like so.</p>
  <p>Consider</p>
  <pre><code> const [proessStatus, setProcessStatus] = useState&lt;ProcessState&gt;();
  
  </code></pre>
  <p>The useState must accept as argument only the values from the ProcessState Object.</p>
  <pre><code>const ProcessState = {
      NOT_STARTED: 'NOT_STARTED',
      STARTED: 'STARTED',
      LOADING: 'LOADING',
      FINISHED: 'FINISHED'
  }
  
  </code></pre>
  <p>Is there a way to ensure this in TypeScript through Interfaces or any other means?</p>