title: Typescript ReturnType with nested functions
body: <p>I'm trying to use <code>ReturnType</code> to generate a type that depends on the return types of functions living on an object.</p>
  
  <p>Here is the object:</p>
  
  <pre><code>const foo = {
    bar: (): number =&gt; 1,
    quux: (): string =&gt; 'a',
  };
  </code></pre>
  
  <p>The desired resulting type is:</p>
  
  <pre><code>type FooLeaves = {
    bar: number;
    quux: string;
  };
  </code></pre>
  
  <p>Is it possible to apply a <code>ResultType</code> to the values of the object in order to pull the return types out of the nested functions?</p>
  
  <p>I guess I could invoke each value and take the type of that, but it seems hacky</p>