export class PostMessage { roomId: string; text?: string; alias?: string; emoji?: string; avatar?: string; attachments?: ChatAttachment[]; constructor(rootId: string) { this.roomId = rootId; } } export class ChatMessage { msg: string; rid: string;// room id u: ChatUserSimpleInfo; ts: Date | { $date: number }; _id: string; _updatedAt: Date | { $date: number }; editedAt?: Date | { $date: number }; editedBy?: ChatUserSimpleInfo; urls?: [{ url: string, meta: string, headers: string, parsedUrl: any }]; attachments?: ChatAttachment[]; alias?: any; avatar?: string; groupable?: boolean; parseUrls?: boolean; file?: { _id: string, name: string, type: string }; /** * 消息类型? */ t?: string; } export class ChatAttachment { color?: string; text?: string; ts?: Date; thumb_url?: string; message_link?: string; collapsed?: boolean; author_name?: string; author_link?: string; author_icon?: string; title?: string; title_link?: string; title_link_download?: boolean; type?: string; image_url?: string; image_dimensions?: { width: number, height: number }; image_preview?: string; image_size?: number; image_type?: string; audio_url?: string; audio_size?: number; audio_type?: string; video_url?: string; video_size?: number; video_type?: string; description?: string; fields?: [{ short?: string, title?: string, value?: string }]; } export class ChatUserSimpleInfo { name: string; username: string; _id: string; }