TypeScript union in enums
<p>I've got a problem in TypeScript that I can't seem to solve.</p>

<p>Here's the code</p>

<pre><code>enum test{
    PowerAttack = 2,
    MagicAttack = 5,
    Attack = PowerAttack &amp;&amp; MagicAttack //invalid
}

document.body.innerHTML = (test.PowerAttack == test.Attack).toString(); //check1
document.body.innerHTML += (test.MagicAttack == test.Attack).toString();//check2
</code></pre>

<p>How can I make the two checks work?</p>

<p>I am trying to make test.Attack be equal to test.PowerAttack AND test.MagicAttack, but I can't make it work.
Is it possible to do that with enums? Please note that I'll have many other entries in the enum, so I don't really want to mess with bitwise operators as it will get unreadable and unmaintainable pretty quickly.</p>

<p>If it's not possible to make it work with enums, what's the best logic to adopt? Classes and sub-classes? Types? Else?</p>