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.

26 lines
564 B

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. // src/eventBus.ts
  2. import mitt from 'mitt'
  3. import { MsgLevel } from './websocket/socket'
  4. export type ErrorDetail = {
  5. name: string
  6. description: string
  7. }
  8. export type ErrorModalData = {
  9. messageLevel: MsgLevel
  10. title: string
  11. info: string
  12. detailInfo?: string
  13. stackInfo?: null
  14. }
  15. export type ConsumeType = 'Plate' | 'LittleBuf' | 'BigBuf' | 'Tip'
  16. type Events = {
  17. initDevice: void,
  18. socketClosed: number,
  19. 'show-error-modal': ErrorModalData
  20. 'show-stack-modal': ErrorModalData['stackInfo'] | null | undefined
  21. }
  22. export const eventBus = mitt<Events>()