Interesting. I swear that when I previously tried this approach I had to explicitly tell typescript that a string is indeed of a particular type:
const test(direction: Direction) => direction;
test('up' as 'up');
But now that I'm testing in typescript playground, I no longer need to write the "as" part — simply `test('up');` works fine as well.I wonder if you've seen this quirk of typescript before.