title: How do I use constants within typescript type definitions?
body: <p>I have a file in my app with a list of constants called ui-constants.ts</p>
  <p>the contents look like as follows:</p>
  <pre><code>export const NO_STATUS = 'NOSTATUS';
  export const DRAFT_STATUS = 'DRAFT';
  export const AWAITING_TRIAGE_STATUS = 'AWAITINGTRIAGE'
  export const COMPLETE_NOT_REQUIRED_STATUS = 'COMPLETENOTREQUIRED';
  export const UNASSIGNED_STATUS = 'UNASSIGNED';
  </code></pre>
  <p>Elsewhere in my reactjs app, I have a file where I attempt to use this:</p>
  <pre><code>import * as UI_CONSTANTS from '../constants/ui-constants';
  
   type RequestStatus =
      | 'NOSTATUS'
      | 'DRAFT'
      | 'AWAITINGTRIAGE'
      | 'COMPLETENOTREQUIRED'
      | 'UNASSIGNED';
  </code></pre>
  <p>Now, the problem is that the application I've picked up is a bit of a mess, with constants used in some places and types used in others.  What I would like to do is use the constants within the type i.e</p>
  <pre><code> type RequestStatus = UI_CONSTANTS.NO_STATUS | UI_CONSTANTS.DRAFT_STATUS | UI_CONSTANTS .AWAITING_TRIAGE_STATUS | UI_CONSTANTS.COMPLETE_NOT_REQUIRED_STATUS 
  </code></pre>
  <p>Doing this results in the following error:</p>
  <p><strong>ui-constants&quot;' has no exported member 'NO_STATUS'.ts(2694)</strong></p>
  <p>The context of this is that I have one developer that is unhappy that literal values are used across the source code where they should be constants, and other that believes typing should be used.</p>
  <p>I'm looking at whether I can achieve the best of both worlds by defining constants and where types are used, specify those constants as values for those types.</p>
  <p>Is this achievable or am I doing this wrong?</p>