<p dir="auto">"axios": "^0.19.0"</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import axios, { AxiosRequestConfig } from 'axios'

axios.defaults.crossDomain = true  //Property 'crossDomain' does not exist on type 'AxiosRequestConfig'. TS (2339)"><pre class="notranslate"><code class="notranslate">import axios, { AxiosRequestConfig } from 'axios'

axios.defaults.crossDomain = true  //Property 'crossDomain' does not exist on type 'AxiosRequestConfig'. TS (2339)
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export interface AxiosRequestConfig {
  url?: string;
  method?: Method;
  baseURL?: string;
  transformRequest?: AxiosTransformer | AxiosTransformer[];
  transformResponse?: AxiosTransformer | AxiosTransformer[];
  headers?: any;
  params?: any;
  paramsSerializer?: (params: any) =&gt; string;
  data?: any;
  timeout?: number;
  withCredentials?: boolean;
  adapter?: AxiosAdapter;
  auth?: AxiosBasicCredentials;
  responseType?: ResponseType;
  xsrfCookieName?: string;
  xsrfHeaderName?: string;
  onUploadProgress?: (progressEvent: any) =&gt; void;
  onDownloadProgress?: (progressEvent: any) =&gt; void;
  maxContentLength?: number;
  validateStatus?: (status: number) =&gt; boolean;
  maxRedirects?: number;
  socketPath?: string | null;
  httpAgent?: any;
  httpsAgent?: any;
  proxy?: AxiosProxyConfig | false;
  cancelToken?: CancelToken;
}"><pre class="notranslate"><code class="notranslate">export interface AxiosRequestConfig {
  url?: string;
  method?: Method;
  baseURL?: string;
  transformRequest?: AxiosTransformer | AxiosTransformer[];
  transformResponse?: AxiosTransformer | AxiosTransformer[];
  headers?: any;
  params?: any;
  paramsSerializer?: (params: any) =&gt; string;
  data?: any;
  timeout?: number;
  withCredentials?: boolean;
  adapter?: AxiosAdapter;
  auth?: AxiosBasicCredentials;
  responseType?: ResponseType;
  xsrfCookieName?: string;
  xsrfHeaderName?: string;
  onUploadProgress?: (progressEvent: any) =&gt; void;
  onDownloadProgress?: (progressEvent: any) =&gt; void;
  maxContentLength?: number;
  validateStatus?: (status: number) =&gt; boolean;
  maxRedirects?: number;
  socketPath?: string | null;
  httpAgent?: any;
  httpsAgent?: any;
  proxy?: AxiosProxyConfig | false;
  cancelToken?: CancelToken;
}
</code></pre></div>
<p dir="auto"><strong>There is no “crossDomain” in interface</strong></p>
<h4 dir="auto">Summary</h4>
<p dir="auto">Allow for typesafe extension of AxiosConfiguration</p>
<h4 dir="auto">Context</h4>
<p dir="auto">Allow for the following user case (without the cast)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    interface Config extends AxiosRequestConfig {
      start?: Date
    }
    const requestConfig: Config = {
      ...
    }
    const instance = axios.create(requestConfig)

    instance.interceptors.request.use(axiosConfig =&gt; {
      const config = axiosConfig as Config // Cast is needed as axiosConfig is infered to AxiosConfiguration and not Config
      config.start = new Date()
      return config
    })
"><pre class="notranslate"><code class="notranslate">    interface Config extends AxiosRequestConfig {
      start?: Date
    }
    const requestConfig: Config = {
      ...
    }
    const instance = axios.create(requestConfig)

    instance.interceptors.request.use(axiosConfig =&gt; {
      const config = axiosConfig as Config // Cast is needed as axiosConfig is infered to AxiosConfiguration and not Config
      config.start = new Date()
      return config
    })

</code></pre></div>