title: Aurelia RoutableComponentActivate implementation
body: <p>I'm sure I'm overlooking something obvious, but I can't seem to see what it is.</p>
  
  <p>I really like having the type safety of Typescript and am trying to incorporate that into my Aurelia project, but am running into a bit of a snag.</p>
  
  <p>I have a <code>LectureDetails.ts</code> component that looks as follows:</p>
  
  <pre><code>import { autoinject } from 'aurelia-framework';
  import { NavigationInstruction, RouteConfig, RoutableComponentActivate } from 'aurelia-router';
  import { ILecture } from './lecture';
  
  @autoinject()
  export class LectureDetails implements RoutableComponentActivate {
    lecture: ILecture;
  
    constructor(private http: HttpClient){}
  
    activate(params: any, routeConfig: RouteConfig, navigationInstruction: NavigationInstruction): Promise&lt;ILecture&gt; {
      return this.http
                 .fecth('/api/lectures/1', { method: 'GET' })
                 .then(response =&gt; response.json())
                 .then(lecture =&gt; this.lecture = lecture)
                 .catch(error =&gt; console.log(error));
    }
  }
  </code></pre>
  
  <p>The problem is the Typescript compiler keeps complaining about the <code>activate</code> method and I can't figure out how to update it to bring it into compliance.</p>
  
  <pre><code>Class 'LectureDetails' incorrectly implements interface 'RoutableComponentActivate'.
  
  Types of property 'activate' are incompatible.
  
  ...
  </code></pre>
  
  <p>It looks like the typings file is expecting a return type of <code>Promise&lt;void&gt; | PromiseLike&lt;void&gt; | IObservable | void</code>, but I don't know how to update the <code>fetch/then</code> methods to be of that type. If I remove the types, the code compiles and runs just fine.</p>
  
  <p>How could I make this method compile and retain the type safety? Why isn't the return type of the <code>RoutableComponentActivate</code> method of type <code>Promise&lt;T&gt;</code>?</p>
  
  <p><strong>UPDATE:</strong> It seems as though, if I update the signature to return <code>Promise&lt;any&gt;</code> then it will compile. I assume the actual type doesn't matter at that point because it is a method called by the framework/convention and therefore the framework doesn't need to know about the type the promise will return when resolved?</p>