diff --git a/src/entities.ts b/src/entities.ts index 386501fd32..ffc0adbbf3 100644 --- a/src/entities.ts +++ b/src/entities.ts @@ -163,6 +163,14 @@ export type MessagingMessage = { groupId: string; // TODO }; +export type CustomEmoji = { + id: string; + name: string; + url: string; + category: string; + aliases: string[]; +}; + export type LiteInstanceMetadata = { maintainerName: string | null; maintainerEmail: string | null; @@ -187,13 +195,7 @@ export type LiteInstanceMetadata = { enableGithubIntegration: boolean; enableDiscordIntegration: boolean; enableServiceWorker: boolean; - emojis: { - id: string; - name: string; - url: string; - category: string; - aliases: string[]; - }[]; + emojis: CustomEmoji[]; ads: { id: ID; ratio: number; diff --git a/src/streaming.ts b/src/streaming.ts index f3efdd9725..c1a4d2ba89 100644 --- a/src/streaming.ts +++ b/src/streaming.ts @@ -3,7 +3,7 @@ import { EventEmitter } from 'eventemitter3'; import ReconnectingWebsocket from 'reconnecting-websocket'; import { stringify } from 'querystring'; import { markRaw } from '@vue/reactivity'; -import { ChannelDef, NoteUpdatedEvent } from './streaming.types'; +import { BroadcasrEvents, ChannelDef } from './streaming.types'; function urlQuery(obj: {}): string { return stringify(Object.entries(obj) @@ -14,8 +14,7 @@ function urlQuery(obj: {}): string { type StreamEvents = { _connected_: void; _disconnected_: void; - noteUpdated: (payload: NoteUpdatedEvent) => void; -}; +} & BroadcasrEvents; /** * Misskey stream connection diff --git a/src/streaming.types.ts b/src/streaming.types.ts index 153d6b6331..a45aadb89d 100644 --- a/src/streaming.types.ts +++ b/src/streaming.types.ts @@ -1,4 +1,4 @@ -import { DriveFile, MeDetailed, MessagingMessage, Note, Notification, PageEvent, User } from './entities'; +import { CustomEmoji, DriveFile, MeDetailed, MessagingMessage, Note, Notification, PageEvent, User } from './entities'; export type ChannelDef = { main: { @@ -80,3 +80,10 @@ export type NoteUpdatedEvent = { userId: User['id']; }; }; + +export type BroadcasrEvents = { + noteUpdated: (payload: NoteUpdatedEvent) => void; + emojiAdded: (payload: { + emoji: CustomEmoji; + }) => void; +};