// 1. Make sure to import 'vue' before declaring augmented types
import Vue from 'vue'
import type { ToastOption } from './components/k-toast/k-toast'
// TODO add types to uni.$k
// import Uni from '@dcloud/types/UniApp'

type TypeK = {
  config: { v: string, version: string },
  props: {
    navigationBar: {
      clickHomeIcon: () => void
    }
  },
  $Toast: {
    showToast(options: ToastOption): Vue,
    hideToast(): void,
    showLoading(options: ToastOption): Vue,
    hideLoading(): void
  }
};

// 2. Specify a file with the types you want to augment
//    Vue has the constructor type in types/vue.d.ts
declare module 'vue/types/vue' {
  // 3. Declare augmentation for Vue
  interface Vue {
    $k: TypeK
  }
}

// declare module '@dcloudio/types/uni-app/UniApp' {
//     interface Uni {
//       $k: TypeK
//     }
// }

export default {
  // eslint-disable-next-line @typescript-eslint/no-empty-function
  install: () => { }
}
