title: TypeScript type string of specific characters
body: <p>Let's say I want to allow a hex string; so the only allowed values would be 0-9a-f. Is there a way in TypeScript to define a type string that only takes certain strings? i.e.</p>
  
  <pre><code>// valid
  const valid: HexString = '123abc';
  // invalid
  const invalid: HexString = 'ijk';
  </code></pre>
  
  <p>I know Regex type definitions is a proposal <a href="https://github.com/Microsoft/TypeScript/issues/6579" rel="nofollow noreferrer">here</a>, was wondering if there was a way to achieve this in the meantime.</p>