// src/eventBus.ts import mitt from 'mitt' export type ErrorDetail = { name: string description: string } export type ErrorModalData = { type: 'Notify' | 'Warn' | 'Error' | 'Fatal' info: string detailInfos?: ErrorDetail[] ecode?: string stackInfo?: null } type Events = { initDevice: void confirm: { value: number; index: number } 'show-error-modal': ErrorModalData 'show-stack-modal': ErrorModalData['stackInfo'] | null | undefined // 其他事件类型 } export const eventBus = mitt()