title: Obtaining the return type of a function
body: <p>I have the following function:</p>
  
  <pre><code>function test(): number {
      return 42;
  }
  </code></pre>
  
  <p>I can obtain the type of the function by using <code>typeof</code>:</p>
  
  <pre><code>type t = typeof test;
  </code></pre>
  
  <p>Here, <code>t</code> will be <code>() =&gt; number</code>.</p>
  
  <p>Is there a way to obtain the return type of the function? I would like <code>t</code> to be <code>number</code> instead of <code>() =&gt; number</code>.</p>