title: Creating type from functions return value
body: <p>I'm trying to get rid of repetition in my typescript react code and I was wondering if it was possible to create a type from functions known return type?</p>
  
  <p>Something like:</p>
  
  <pre><code>const mapStateToProps = (state: StoreState) =&gt; ({settings: store.settings})
  type Props = ReturnTypeOf&lt;typeof mapStateToProps&gt;
  </code></pre>