fchat-rising/chat/preview/event-bus.ts

51 lines
1.4 KiB
TypeScript
Raw Normal View History

2019-06-08 02:26:01 +00:00
import Vue from 'vue';
2020-03-15 16:23:39 +00:00
import { Character } from '../../site/character_page/interfaces';
import { Message } from '../common';
import { Conversation } from '../interfaces';
2019-07-07 01:37:15 +00:00
import ChannelConversation = Conversation.ChannelConversation;
2020-11-27 06:12:47 +00:00
import { NoteCheckerCount } from '../../site/note-checker';
2019-07-07 01:37:15 +00:00
/**
* 'imagepreview-dismiss': {url: string}
* 'imagepreview-show': {url: string}
* 'imagepreview-toggle-stickyness': {url: string}
* 'character-data': {character: Character}
2019-07-15 16:59:16 +00:00
* 'character-score': {character: Character, score: number}
2019-07-07 01:37:15 +00:00
* 'private-message': {message: Message}
* 'channel-ad': {message: Message, channel: Conversation, profile: ComplexCharacter | undefined}
2019-07-07 01:37:15 +00:00
* 'channel-message': {message: Message, channel: Conversation}
* 'select-conversation': { conversation: Conversation }
2020-11-27 06:12:47 +00:00
* 'note-counts-update': {}
2019-07-07 01:37:15 +00:00
*/
2019-07-06 16:49:19 +00:00
export interface EventBusEvent {
// tslint:disable: no-any
[key: string]: any;
}
2019-07-07 01:37:15 +00:00
export interface ChannelMessageEvent extends EventBusEvent {
message: Message;
channel: ChannelConversation;
}
// tslint:disable-next-line no-empty-interface
export interface ChannelAdEvent extends ChannelMessageEvent {}
export interface CharacterDataEvent {
character: Character;
}
export interface SelectConversationEvent extends EventBusEvent {
conversation: Conversation;
}
2020-11-27 06:12:47 +00:00
// tslint:disable-next-line no-empty-interface
export interface NoteCountsUpdate extends EventBusEvent, NoteCheckerCount {}
2019-06-08 02:26:01 +00:00
export const EventBus = new Vue();