Looking for a way to implement literal type restrictions without using type aliases:
const foo = (a: 'string', b: 'string') => { }
foo("123", "abc") // should fail
foo("123" as 'string', "abc" as 'string')
I prefer not to use type alias and instead create my own type. Although I can use objects as a workaround, I find that using strings keeps everything much cleaner in my code.