/// <reference types="vite/client" />

declare const VE_ENV: {
  MODE: string
  SERVER: string
  PYSERVER: string
  MOCK: string
}

interface ImportMetaEnv {
  readonly VITE_SERVER: string
  readonly VITE_PYSERVER: string
  readonly VITE_MOCK: string
}

interface ImportMeta {
  readonly env: ImportMetaEnv
}

declare global {
  interface Window {
    VE_API?: Record<string, Record<string, unknown>>
    isMoved?: boolean
    isMuted?: boolean
  }
}

declare module '*.json' {
  const value: Record<string, unknown>[]
  export default value
}

declare module '*.vue' {
  import type { DefineComponent } from 'vue'
  const component: DefineComponent<object, object, unknown>
  export default component
}

declare module '@/router/index.js' {
  import type { Router } from 'vue-router'
  const router: Router
  export default router
}

declare module '@/store/index.js' {
  import type { Store } from 'vuex'
  const store: Store<unknown>
  export default store
}

declare module '@/plugins/axios.js' {
  import type { Plugin } from 'vue'
  import type { Router } from 'vue-router'
  import type { Store } from 'vuex'

  type AxiosPluginOptions = {
    router: Router
    store: Store<unknown>
    opt: string
  }

  const axiosPlugin: Plugin<[AxiosPluginOptions]>
  export default axiosPlugin
}

export {}

declare module 'vue' {
  interface ComponentCustomProperties {
    VE_API: Record<string, Record<string, (...args: unknown[]) => Promise<unknown>>>
  }
}
