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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* '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}
|
2019-07-08 19:08:16 +00:00
|
|
|
* 'channel-ad': {message: Message, channel: Conversation, profile: ComplexCharacter | undefined}
|
2019-07-07 01:37:15 +00:00
|
|
|
* 'channel-message': {message: Message, channel: Conversation}
|
2020-06-16 16:27:31 +00:00
|
|
|
* 'select-conversation': { conversation: Conversation }
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-06-08 02:26:01 +00:00
|
|
|
export const EventBus = new Vue();
|
|
|
|
|