import mitt, { type Emitter } from 'mitt'

/**
 * 全局事件总线
 * 用法：emitter.emit('logout') / emitter.on('logout', handler)
 */
type Events = {
  logout: void
  refresh: string
}

const emitter: Emitter<Events> = mitt<Events>()

export default emitter
