title: Axios interceptors with Typescript
body: <p>How to correctly use axios's inteceptors with typescript:</p>
  
  <pre><code>import axios, { AxiosRequestConfig, AxiosInstance } from 'axios'
  
  HTTP.interceptors.request.use((config: AxiosRequestConfig) =&gt; config)
  </code></pre>
  
  <p>For example, when i create axios instance, i set up default config:</p>
  
  <pre><code>const conf: AxiosRequestConfig = {
    baseURL: process.env.VUE_APP_API_URL
  }
  
  const HTTP: AxiosInstance = axios.create(conf)
  </code></pre>
  
  <p>But when i try to use interceptor with custom headers:</p>
  
  <pre><code>HTTP.interceptors.request.use((config: AxiosRequestConfig) =&gt;{
    headers: {
      'x-projectkey': 1234
    }
  })
  </code></pre>
  
  <p>It doesn't work:</p>
  
  <pre><code>Argument of type '(config: AxiosRequestConfig) =&gt; void' is not assignable to parameter of type '(value: AxiosRequestConfig) =&gt; AxiosRequestConfig | Promise&lt;AxiosRequestConfig&gt;'
  </code></pre>
  
  <p>I'm still new to TS, can't figure this out.</p>