Haxe doesn’t have a direct equivalent to TypeScript’s more advanced typing features. Enum abstracts might be the closest you’ll get.
That said, if you’re willing to dig into macros, almost anything becomes possible. I forget if generic macros work on enum abstracts, but if they did they could probably reproduce the feature you’re looking for.
Sadly, they aren’t well-documented. The manual doesn’t even mention that you can use the name Rest to take a variable number of type params. So then you could declare a Union<Rest> type with a build macro attached, and when the user asked for Union<Armor, Weapon>, you’d generate that type.