title: Especify union type in typescript
body: <p>I have something like this:</p>
  
  <pre><code>interface ISome {
      myValue: number | string;
      // some more members
  }
  </code></pre>
  
  <p>And I have a function that will acept an <code>ISome</code> whose <code>myValue</code> is a number, and use it like:</p>
  
  <pre><code>function (some: ISome): number { // I accept only ISome with myValue type number
      return some.myValue + 3;
  }
  </code></pre>
  
  <p>The typescript compiler complains as expected because <code>some.myValue</code> is number or string.
  Of course I could use a union type to check:</p>
  
  <pre><code>function (some: ISome): number { // I could use a guard
      if (typeof some.myValue === "number") {
          return some.myValue + 3;
      }
  }
  </code></pre>
  
  <p>But this is not what I want as I need to do this very often.</p>