// src/eventBus.ts import mitt from 'mitt' import { MsgLevel } from './websocket/socket' export type ErrorDetail = { name: string description: string } export type ErrorModalData = { messageLevel: MsgLevel title: string info: string detailInfo?: string stackInfo?: null } export type ConsumeType = 'Plate' | 'LittleBuf' | 'BigBuf' | 'Tip' type Events = { initDevice: void, socketClosed: number, 'show-error-modal': ErrorModalData 'show-stack-modal': ErrorModalData['stackInfo'] | null | undefined } export const eventBus = mitt()