Your case is valid if the variable being used is a constant, in that case a const enum would be best of both world.
But imagine you are writing a game, and game states needs to be manipulate at runtime. In that case, it would be required to bundle entire object in final build. An Enum of game state would be better, especially if you are making a game library, which would be used by other developers ( who may be an old fashion JS devs).
Your case is valid if the variable being used is a constant, in that case a const enum would be best of both world.
But imagine you are writing a game, and game states needs to be manipulate at runtime. In that case, it would be required to bundle entire object in final build. An Enum of game state would be better, especially if you are making a game library, which would be used by other developers ( who may be an old fashion JS devs).
Real use case scenario of union types would be something like this