forked from gzt/A8000
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
505 B
24 lines
505 B
// 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 = {
|
|
confirm: { value: number; index: number }
|
|
'show-error-modal': ErrorModalData
|
|
'show-stack-modal': ErrorModalData['stackInfo'] | null | undefined
|
|
// 其他事件类型
|
|
}
|
|
|
|
export const eventBus = mitt<Events>()
|