2022-01-11 13:51:48 +00:00
|
|
|
import Model from '@nozbe/watermelondb/Model';
|
|
|
|
import { MarkdownAST } from '@rocket.chat/message-parser';
|
|
|
|
|
|
|
|
import { IAttachment } from './IAttachment';
|
2022-02-16 21:14:28 +00:00
|
|
|
import { IEditedBy, IUserChannel, IUserMention, IUserMessage, MessageType } from './IMessage';
|
2022-01-11 13:51:48 +00:00
|
|
|
import { IReaction } from './IReaction';
|
2022-02-16 15:17:25 +00:00
|
|
|
import { IUrl } from './IUrl';
|
2022-01-11 13:51:48 +00:00
|
|
|
|
|
|
|
interface IFileThread {
|
|
|
|
_id: string;
|
|
|
|
name: string;
|
|
|
|
type: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IThreadResult {
|
|
|
|
_id: string;
|
|
|
|
rid: string;
|
2022-02-17 00:07:24 +00:00
|
|
|
ts: string | Date;
|
|
|
|
msg?: string;
|
2022-01-11 13:51:48 +00:00
|
|
|
file?: IFileThread;
|
|
|
|
files?: IFileThread[];
|
|
|
|
groupable?: boolean;
|
|
|
|
attachments?: IAttachment[];
|
|
|
|
md?: MarkdownAST;
|
|
|
|
u: IUserMessage;
|
2022-02-17 00:07:24 +00:00
|
|
|
_updatedAt: Date;
|
|
|
|
urls?: IUrl[];
|
|
|
|
mentions?: IUserMention[];
|
|
|
|
channels?: IUserChannel[];
|
|
|
|
replies?: string[];
|
|
|
|
tcount?: number;
|
|
|
|
tlm?: Date;
|
2022-01-11 13:51:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IThread {
|
|
|
|
id: string;
|
2022-02-16 21:14:28 +00:00
|
|
|
tmsg?: string;
|
2022-01-11 13:51:48 +00:00
|
|
|
msg?: string;
|
2022-02-16 21:14:28 +00:00
|
|
|
t?: MessageType;
|
2022-01-24 18:35:06 +00:00
|
|
|
rid: string;
|
2022-01-17 16:10:39 +00:00
|
|
|
_updatedAt?: Date;
|
2022-02-22 12:04:01 +00:00
|
|
|
ts?: string | Date;
|
2022-01-17 16:10:39 +00:00
|
|
|
u?: IUserMessage;
|
2022-01-11 13:51:48 +00:00
|
|
|
alias?: string;
|
|
|
|
parseUrls?: boolean;
|
|
|
|
groupable?: boolean;
|
|
|
|
avatar?: string;
|
|
|
|
emoji?: string;
|
|
|
|
attachments?: IAttachment[];
|
|
|
|
urls?: IUrl[];
|
|
|
|
status?: number;
|
|
|
|
pinned?: boolean;
|
|
|
|
starred?: boolean;
|
|
|
|
editedBy?: IEditedBy;
|
|
|
|
reactions?: IReaction[];
|
|
|
|
role?: string;
|
|
|
|
drid?: string;
|
2022-01-17 14:18:32 +00:00
|
|
|
dcount?: number | string;
|
2022-01-11 13:51:48 +00:00
|
|
|
dlm?: number;
|
|
|
|
tmid?: string;
|
2022-01-17 14:18:32 +00:00
|
|
|
tcount?: number | string;
|
2022-01-17 20:15:58 +00:00
|
|
|
tlm?: string;
|
2022-01-11 13:51:48 +00:00
|
|
|
replies?: string[];
|
|
|
|
mentions?: IUserMention[];
|
|
|
|
channels?: IUserChannel[];
|
|
|
|
unread?: boolean;
|
|
|
|
autoTranslate?: boolean;
|
|
|
|
translations?: any;
|
|
|
|
e2e?: string;
|
2022-02-22 12:04:01 +00:00
|
|
|
subscription?: { id: string };
|
2022-01-11 13:51:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type TThreadModel = IThread & Model;
|