Archived
2
0
This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
neko-custom/client/src/lib.ts

66 lines
1.5 KiB
TypeScript
Raw Normal View History

2021-03-10 03:56:52 +13:00
import { accessor as neko } from './store'
2021-03-10 05:16:53 +13:00
import { PluginObject } from 'vue'
2021-03-10 06:02:20 +13:00
2021-03-10 03:56:52 +13:00
// Plugins
import Logger from './plugins/log'
import Client from './plugins/neko'
import Axios from './plugins/axios'
import Swal from './plugins/swal'
import Anime from './plugins/anime'
2021-03-10 05:16:53 +13:00
import { i18n } from './plugins/i18n'
2021-03-10 03:56:52 +13:00
// Components
import Connect from '~/components/connect.vue'
import Video from '~/components/video.vue'
import Menu from '~/components/menu.vue'
import Side from '~/components/side.vue'
import Controls from '~/components/controls.vue'
import Members from '~/components/members.vue'
import Emotes from '~/components/emotes.vue'
import About from '~/components/about.vue'
import Header from '~/components/header.vue'
const exportMixin = {
computed: {
$accessor() {
return neko
},
$client () {
return window.$client
}
},
}
2021-03-10 05:16:53 +13:00
const plugini18n: PluginObject<undefined> = {
install(Vue) {
Vue.prototype.i18n = i18n
Vue.prototype.$t = i18n.t.bind(i18n)
},
}
2021-03-10 03:56:52 +13:00
function extend (component: any) {
return component
2021-03-10 05:16:53 +13:00
.use(plugini18n)
2021-03-10 03:56:52 +13:00
.use(Logger)
.use(Axios)
.use(Swal)
.use(Anime)
.use(Client)
.extend(exportMixin)
}
export const components = {
'neko-connect': extend(Connect),
'neko-video': extend(Video),
'neko-menu': extend(Menu),
'neko-side': extend(Side),
'neko-controls': extend(Controls),
'neko-members': extend(Members),
'neko-emotes': extend(Emotes),
'neko-about': extend(About),
'neko-header': extend(Header),
}
neko.initialise()
2021-03-10 06:02:20 +13:00
export default neko