You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OneAuth/oaer/lib/main.ts

36 lines
603 B
TypeScript

/*
* main.ts
* Copyright (C) 2024 veypi <i@veypi.com>
* 2024-07-04 14:34
* Distributed under terms of the MIT license.
*/
import './assets/css/oaer.scss'
1 month ago
import bus from './bus'
1 month ago
import ui from './components'
export class OAer {
1 month ago
host: string
domid?: string
ui?: ui
constructor(host: string, domid?: string) {
this.host = host
if (domid) {
this.domid = domid
this.ui = new ui(document.querySelector(`#${this.domid}`)!)
}
}
1 month ago
login() {
bus.emit('login')
}
1 month ago
logout() {
bus.emit('logout')
}
1 month ago
onlogout(fc: () => void) {
bus.on('logout', fc)
}
}