title: Typescript With Axios Response
body: <p>Working with Typescript while making an API call with <code>axios</code> and have come across a nested data scenario.</p>
  <p>Although I believe to have it typed correctly, I keep receiving a Typescript error stating <code>Unsafe return on an any typed value</code> and <code>Unsafe member access .data on an any value</code> for the <code>return response.data.data[0];</code> line of my <code>try/catch</code>. Can someone provide some clarity around why my types aren't working as I &quot;think&quot; they are?</p>
  <pre><code>export interface Source {
    curr: string;
    uuid: string;
    rate: string;
  }
  
  export interface Response {
    data: {
      data: Array&lt;Source&gt;;
    };
  }
  
  async function getSource({ curr, uuid, rate }: Source): Promise&lt;AxiosResponse&lt;Response&gt;&gt; {
    const requestConfig: AxiosRequestConfig = {
      method: 'get',
      url: '/url',
    };
  
    try {
      const response = await axios(requestConfig);
      return response.data.data[0];
    } catch (err) {
      throw new Error('error');
    }
  }
  </code></pre>