title: TypeScript type Function returning a Promise
body: <p>I am building an ionic app that is pulling in an rss feed from iTunes. I am able to get the rss feed and display the entries on my app.</p>
  
  <p>I am getting this error, and would like to understand how to properly set up the variable.</p>
  
  <pre><code>export class MyPage {
      episodes: any;
  
      ...
  
  
      getRssFeed() {
          this.rssProvider.getFeed(this.rssUrl)
              .then(data =&gt; {
                  console.log(data);
                  this.episodes = data.items;
          });
      }
  }
  </code></pre>
  
  <p><strong>rssProvider.ts</strong></p>
  
  <pre><code>...
  
  getFeed(rssUrl: string) {
      try {
          return new Promise(resolve =&gt; {
              this.http.get(`${this.baseUrl}?rss_url=${rssUrl}&amp;api_key=${this.apiKey}&amp;count=${this.count}`).subscribe(data =&gt; {
              resolve(data);
          }, error =&gt; {
             console.error(error);
          });
        });
      } catch (error) {
          console.error('Something really bad happened trying to get rss feed.');
          console.error(error);
      }
  }
  </code></pre>
  
  <p>I am using WebStorm for my IDE if that is of any significance.</p>
  
  <p>This is the error I am getting:</p>
  
  <pre><code>Typescript Error:
  Property 'items' does not exist on type '{}'.
  </code></pre>
  
  <p>Which ok, <code>items</code> is coming back, so ionic doesn't know what it is. Is there a proper way to declare the variable so I don't get the red error hinting?</p>
  
  <p>Thank you for any suggestions!</p>