import 'axios';

declare module 'axios' {
  export interface AxiosRequestConfig {
    /**
     * When true, the request interceptor skips token management entirely.
     * Use this for pre-auth endpoints (login, SSO, OTP, password reset) and
     * any call that supplies its own Authorization header (refresh, token-login).
     */
    skipInterceptor?: boolean;
    /**
     * When true, a 404 response will not trigger the global navigate('/') redirect.
     * Use for embedded/secondary resource fetches where a not-found state should be
     * handled at the component level (e.g. shared post original that may have been deleted).
     */
    skipNotFoundRedirect?: boolean;
  }

  // InternalAxiosRequestConfig extends AxiosRequestConfig, so the field is already
  // inherited at runtime. Augmenting it explicitly makes it directly available in
  // interceptor callbacks typed as InternalAxiosRequestConfig without relying on inheritance.
  export interface InternalAxiosRequestConfig {
    skipInterceptor?: boolean;
    skipNotFoundRedirect?: boolean;
  }
}
