import { GlobalLogger } from "js-logger";

interface PrevalType {
  require: (path: string) => Object;
}
declare global {
  declare const globalProps: any;
  declare const logger: GlobalLogger;
  declare const preval: PrevalType;

  interface Window {
    globalProps: any;
    logger: GlobalLogger;
    preval: PrevalType;
    NeetoChat?: {
      contextualHelp: {
        maximizeWidget: () => void;
        openWidget: () => void;
      };
    };
  }

  declare module "assets/*" {
    const content: any;
    export default content;
  }

  declare module "*.json" {
    const content: any;
    export default content;
  }
}

declare module "axios" {
  interface CustomRequestConfig extends AxiosRequestConfig {
    showToastr?: Boolean;
    includeMetadataInResponse?: Boolean;
    transformResponseCase?: Boolean;
    transformRequestCase?: Boolean;
    redirectOnError?: Boolean;
    show404ErrorPage?: Boolean;
    show403ErrorPage?: Boolean;
    show422ErrorToastr?: Boolean;
  }
  export interface AxiosInstance {
    request(config: CustomRequestConfig): Promise<any>;
    get(url: string, config?: CustomRequestConfig): Promise<any>;
    delete(url: string, config?: CustomRequestConfig): Promise<any>;
    head(url: string, config?: CustomRequestConfig): Promise<any>;
    post(url: string, data?: any, config?: CustomRequestConfig): Promise<any>;
    put(url: string, data?: any, config?: CustomRequestConfig): Promise<any>;
    patch(url: string, data?: any, config?: CustomRequestConfig): Promise<any>;
  }
}
