title: Axios, Typescript, and Promises
body: <p>This may be more of a TypeScript question.  I have a REST method that is called within my http library by Vue action.  I'd like the resolve() method to return the typed array, but unless I do the conversion within the action.ts "then" method, I receive a '.length does not exist in type {}'</p>
  
  <p>Is there any way to not have to re-cast the result to my typed array since it was already done in the http.ts method?</p>
  
  <p>http.ts (partial)</p>
  
  <pre><code>getapps() {        
          return new Promise((resolve, reject) =&gt; {
              this.axios.post('/account/getapps').then((response) =&gt; {
                  resolve(response.data as DomainAppType[]);
              }, (err) =&gt; {
                  reject(err);
              });
           });
      }
  </code></pre>
  
  <p>action.ts</p>
  
  <pre><code>import { DomainAppType } from '../models/domainApps';
  
  var actions = {
      LOGIN: function ({ commit }, params) {
          http.getapps(params.email, params.password).then(apps =&gt; {
              var appList = &lt;DomainAppType[]&gt;apps;
              console.log(appList.length);
          }).catch((err) =&gt; {
              console.log(JSON.stringify(err));
          })
  
        }
  }
  export default actions
  </code></pre>