typescript extend string literal types code example
Example: typescript string to string literal
// stringLiteral is type of 'someString', not string
const stringLiteral = 'someString' as 'someString';
// stringLiteral is type of 'someString', not string
const stringLiteral = 'someString' as 'someString';