Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
m1k1o
GitHub Repository: m1k1o/neko
Path: blob/master/client/src/plugins/neko.ts
1301 views
1
import { PluginObject } from 'vue'
2
import { NekoClient } from '~/neko'
3
4
declare global {
5
const $client: NekoClient
6
7
interface Window {
8
$client: NekoClient
9
}
10
}
11
12
declare module 'vue/types/vue' {
13
interface Vue {
14
$client: NekoClient
15
}
16
}
17
18
const plugin: PluginObject<undefined> = {
19
install(Vue) {
20
window.$client = new NekoClient()
21
.on('error', window.$log.error)
22
.on('warn', window.$log.warn)
23
.on('info', window.$log.info)
24
.on('debug', window.$log.debug)
25
26
Vue.prototype.$client = window.$client
27
},
28
}
29
30
export default plugin
31
32