import type { Update } from '@tauri-apps/plugin-updater';
import mitt from 'mitt';

type MittEvents = {
  /** 应用更新 */
  APP_UPDATE: Update;
};

type MittKey = keyof MittEvents;

/** 应用更新 */
export const APP_UPDATE = 'APP_UPDATE' satisfies MittKey;

/**
 * 全局事件总线
 */
export const $mitt = mitt<MittEvents>();
