title: TypeScript: Can I provide a type alias for an overloaded function signature?
body: <p>Is it possible to create a type alias for an overloaded function signature?</p>
  
  <p>For example, I have a function like:</p>
  
  <pre><code>function whenChanged(scope: ng.IScope, fn: ()=&gt;void): ()=&gt;void;
  function whenChanged(fn: ()=&gt;void, truthy:any): ()=&gt;void;
  function whenChanged(a,b): ()=&gt;void {
      //...
  }
  </code></pre>
  
  <p>I would like to create type alias to that overloaded signature to save repetition, and make use of in other places where I need to describe the type of this function.</p>
  
  <p>I tried:</p>
  
  <pre><code>type WC1 = (scope: ng.IScope, fn: ()=&gt;void) =&gt; ()=&gt;void;
  type WC2 = (fn: ()=&gt;void, truthy:any) =&gt; ()=&gt;void;
  type WhenChanged = WC1 | WC2;
  
  const whenChanged: WhenChanged = (a,b) =&gt; {
      //...
  };
  </code></pre>
  
  <p>But trying to use this function, I get an error along the lines of "Cannot invoke an expression whose type lacks a call signature".</p>
  
  <p>I cannot offhand see anything in the docs about type aliasing function overloads.   </p>