Make TypeScript accept exactly the values you expect — nothing more, nothing less.
Literal types let you describe a value using its exact value instead of just its general type. For example, instead of saying a variable is a string, you can tell TypeScript it can only be "success", "error", or "loading". This makes your code much more predictable.
You will see literal types often when working with APIs, configuration objects, states, and function parameters. They become even more useful when combined with unions, because you can clearly define every value your code is allowed to receive.
What you'll walk away knowing