fchat-rising/chat/event-bus.ts

39 lines
1.1 KiB
TypeScript
Raw Normal View History

2019-06-08 02:26:01 +00:00
import Vue from 'vue';
2019-07-07 01:37:15 +00:00
import { Character } from '../site/character_page/interfaces';
import { Message } from './common';
import { Conversation } from './interfaces';
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}
* 'channel-ad': {message: Message, channel: Conversation, profile: ComplexCharacter | undefined}
2019-07-07 01:37:15 +00:00
* 'channel-message': {message: Message, channel: Conversation}
*/
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();