title: RxJs / Typescript throws 'property clientX does not exist on type {}'
body: <p>I am trying to do something very simple, just log the event.clientX on mouseover, and this is the module code:</p>
  
  <pre><code>import { Observable, Subject } from 'rxjs';
  import StarSky from './starsky';
  import constants from '../constants/index';
  
  const HERO_Y = constants.HERO_Y(StarSky.canvas);
  
  export const StarShip = Observable.fromEvent(StarSky.canvas,'mousemove')
    .map((event)=&gt; {
      return {
        x: event.clientX,
        y: HERO_Y
      }
    })
    .startWith({
      x: StarSky.canvas.width /2,
      y: HERO_Y
    })
  </code></pre>
  
  <p>Then I subscribe to it later, likeso:</p>
  
  <pre><code>StarShip.subscribe(x =&gt;  console.log(x));
  </code></pre>
  
  <p>What is happening is that typescript compiler keeps throwing an error of this particular kind:</p>
  
  <pre><code>Property clientX does not exist on type {}
  </code></pre>
  
  <p>I am guessing because its still an empty Rx Subject, and clientX is not yet still there as it needs to be initialised via mouseover. This is kind of silly because if I remove <code>.clientX</code>, and leave <code>event</code> there as <code>x</code>, it logs out with no problems.</p>
  
  <p>How to combat this incompatibility and work around this error?</p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>I am sorry, just found out that the solution is to put type declaration</p>
  
  <pre><code>(event: MouseEvent) =&gt; { ... }
  </code></pre>
  
  <p>Just like this.</p>