mattermost-mobile/types/api/websocket.d.ts

33 lines
810 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
type WebsocketBroadcast = {
omit_users: Dictionary<boolean>;
user_id: string;
channel_id: string;
team_id: string;
}
type WebSocketMessage<T = any> = {
event: string;
data: T;
broadcast: WebsocketBroadcast;
seq: number;
}
type ThreadReadChangedData = {
thread_id: string;
timestamp: number;
unread_mentions: number;
unread_replies: number;
};
type PostTranslationUpdateData = {
object_id: string;
translations: Record<string, {
state: 'ready' | 'skipped' | 'processing' | 'unavailable';
translation: string; // JSON-encoded PostTranslation['object']
translation_type?: string;
src_lang?: string;
}>;
}