title: Extract typescript types from function to Object
body: <p>Trying to generate types from given functions types. I would like to get the return type directly from the function and map to the key of the object shown below. There is <code>ReturnType</code> I tried but it was not accepting the <code>reducers</code> structure.</p>
  
  <pre><code>type A = { a: string } 
  type B = {  b: string }
  type Reducers = {
    aA: (a) =&gt; A,
    bB:(b) =&gt; B,
  }
  
  const reducers: Reducers = {
    aA: (a) =&gt; { a },
    bB: (b) =&gt; {b },
  }
  </code></pre>
  
  <p>how to get the store state like</p>
  
  <pre><code>namespace Store {  // I will provide this
    type Project = { // here is where I need to generated types based on reducer function like`type Project = ....`
       aA: A,
       bB: B,
    } 
  }
  </code></pre>