import mitt from 'mitt'; import { ObjectType, UserProfile, MessageDto } from '@nicestack/common'; export enum CrudOperation { CREATED, UPDATED, DELETED } type Events = { genDataEvent: { type: "start" | "end" }, markDirty: { objectType: string, id: string, staff?: UserProfile, subscribers?: string[] } updateViewCount: { id: string, objectType: ObjectType }, onMessageCreated: { data: Partial }, dataChanged: { type: string, operation: CrudOperation, data: any } }; const EventBus = mitt(); export default EventBus;