feat: Add emoji and alot of other fixes

This commit is contained in:
2026-06-05 05:40:18 +02:00
parent ca069e2f61
commit 6865147e8f
72 changed files with 3885 additions and 413 deletions

View File

@@ -10,6 +10,11 @@ import type { VoiceState } from './voice-state.models';
import type { GameActivity } from './game-activity.models';
import type { BanEntry } from './moderation.models';
import type { ChatAttachmentAnnouncement, ChatAttachmentMeta } from './attachment-contracts';
import type {
CustomEmoji,
CustomEmojiSummaryItem,
CustomEmojiTransferManifest
} from './custom-emoji.models';
import type {
DirectMessageEventPayload,
DirectMessageMutationEventPayload,
@@ -96,6 +101,10 @@ export interface ChatEventBase {
directMessageSync?: DirectMessageSyncEventPayload;
directCall?: DirectCallEventPayload;
pluginMessage?: unknown;
customEmoji?: CustomEmoji;
customEmojiTransfer?: CustomEmojiTransferManifest;
customEmojiSummaries?: CustomEmojiSummaryItem[];
customEmojiId?: string;
}
export interface ChatMessageEvent extends ChatEventBase {
@@ -424,6 +433,31 @@ export interface PluginMessageBusPeerEvent extends ChatEventBase {
pluginMessage: unknown;
}
export interface CustomEmojiSummaryEvent extends ChatEventBase {
type: 'custom-emoji-summary';
customEmojiSummaries: CustomEmojiSummaryItem[];
}
export interface CustomEmojiRequestEvent extends ChatEventBase {
type: 'custom-emoji-request';
ids: string[];
}
export interface CustomEmojiFullEvent extends ChatEventBase {
type: 'custom-emoji-full';
customEmoji?: CustomEmoji;
customEmojiTransfer?: CustomEmojiTransferManifest;
total?: number;
}
export interface CustomEmojiChunkEvent extends ChatEventBase {
type: 'custom-emoji-chunk';
customEmojiId: string;
index: number;
total: number;
data: string;
}
/** Discriminated union of all P2P chat events. Narrow via `event.type`. */
export type ChatEvent =
| ChatMessageEvent
@@ -481,7 +515,11 @@ export type ChatEvent =
| DirectMessageSyncRequestPeerEvent
| DirectMessageSyncPeerEvent
| DirectCallPeerEvent
| PluginMessageBusPeerEvent;
| PluginMessageBusPeerEvent
| CustomEmojiSummaryEvent
| CustomEmojiRequestEvent
| CustomEmojiFullEvent
| CustomEmojiChunkEvent;
/** All possible `type` values, derived from the union. */
export type ChatEventType = ChatEvent['type'];