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.
// valid
const valid: HexString = '123abc';
// invalid
const invalid: HexString = 'ijk';
I know Regex type definitions is a proposal here, was wondering if there was a way to achieve this in the meantime.