17 lines
547 B
TypeScript
17 lines
547 B
TypeScript
import mitt from 'mitt';
|
|
import { ObjectType, UserProfile, MessageDto } from '@nice/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<MessageDto> },
|
|
dataChanged: { type: string, operation: CrudOperation, data: any }
|
|
};
|
|
const EventBus = mitt<Events>();
|
|
export default EventBus;
|