2021-10-20 16:32:58 +00:00
|
|
|
import { MarkdownAST } from '@rocket.chat/message-parser';
|
2022-03-21 20:44:06 +00:00
|
|
|
import { StyleProp, TextStyle } from 'react-native';
|
2021-10-20 16:32:58 +00:00
|
|
|
|
2022-02-17 15:27:01 +00:00
|
|
|
import { IUserChannel, IUserMention } from '../markdown/interfaces';
|
|
|
|
import { TGetCustomEmoji } from '../../definitions/IEmoji';
|
2022-03-21 20:44:06 +00:00
|
|
|
import { IAttachment } from '../../definitions';
|
2022-02-17 15:27:01 +00:00
|
|
|
|
2022-01-24 18:35:06 +00:00
|
|
|
export type TMessageType = 'discussion-created' | 'jitsi_call_started';
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
export interface IMessageAttachments {
|
2022-03-21 20:44:06 +00:00
|
|
|
attachments?: IAttachment[];
|
2022-03-02 14:18:01 +00:00
|
|
|
timeFormat?: string;
|
2022-03-21 20:44:06 +00:00
|
|
|
style?: StyleProp<TextStyle>[];
|
|
|
|
isReply?: boolean;
|
|
|
|
showAttachment?: Function;
|
2022-02-17 15:27:01 +00:00
|
|
|
getCustomEmoji: TGetCustomEmoji;
|
2021-09-13 20:41:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMessageAttachedActions {
|
2022-03-21 20:44:06 +00:00
|
|
|
attachment: IAttachment;
|
2021-09-13 20:41:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMessageAvatar {
|
|
|
|
isHeader: boolean;
|
|
|
|
avatar: string;
|
|
|
|
emoji: string;
|
|
|
|
author: {
|
|
|
|
username: string;
|
|
|
|
_id: string;
|
|
|
|
};
|
|
|
|
small?: boolean;
|
|
|
|
navToRoomInfo: Function;
|
2022-02-17 15:27:01 +00:00
|
|
|
getCustomEmoji: TGetCustomEmoji;
|
2021-09-13 20:41:05 +00:00
|
|
|
theme: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMessageBlocks {
|
|
|
|
blocks: any;
|
|
|
|
id: string;
|
|
|
|
rid: string;
|
|
|
|
blockAction: Function;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMessageBroadcast {
|
|
|
|
author: {
|
|
|
|
_id: string;
|
|
|
|
};
|
|
|
|
broadcast: boolean;
|
|
|
|
theme: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMessageCallButton {
|
|
|
|
theme: string;
|
|
|
|
callJitsi: Function;
|
|
|
|
}
|
|
|
|
|
2021-10-20 16:32:58 +00:00
|
|
|
export interface IUser {
|
2022-01-17 16:10:39 +00:00
|
|
|
id: string;
|
2021-10-20 16:32:58 +00:00
|
|
|
username: string;
|
2022-01-17 16:10:39 +00:00
|
|
|
token: string;
|
2021-10-20 16:32:58 +00:00
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
export interface IMessageContent {
|
2021-11-10 17:56:19 +00:00
|
|
|
_id: string;
|
2021-09-13 20:41:05 +00:00
|
|
|
isTemp: boolean;
|
|
|
|
isInfo: boolean;
|
2022-03-02 14:18:01 +00:00
|
|
|
tmid?: string;
|
2021-09-13 20:41:05 +00:00
|
|
|
isThreadRoom: boolean;
|
2022-03-02 14:18:01 +00:00
|
|
|
msg?: string;
|
|
|
|
md?: MarkdownAST;
|
2021-09-13 20:41:05 +00:00
|
|
|
theme: string;
|
|
|
|
isEdited: boolean;
|
|
|
|
isEncrypted: boolean;
|
2022-02-17 15:27:01 +00:00
|
|
|
getCustomEmoji: TGetCustomEmoji;
|
2022-03-02 14:18:01 +00:00
|
|
|
channels?: IUserChannel[];
|
|
|
|
mentions?: IUserMention[];
|
|
|
|
navToRoomInfo?: Function;
|
|
|
|
useRealName?: boolean;
|
2021-09-13 20:41:05 +00:00
|
|
|
isIgnored: boolean;
|
|
|
|
type: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMessageDiscussion {
|
2022-03-02 14:18:01 +00:00
|
|
|
msg?: string;
|
|
|
|
dcount?: number;
|
|
|
|
dlm?: Date;
|
2021-09-13 20:41:05 +00:00
|
|
|
theme: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMessageEmoji {
|
|
|
|
content: any;
|
|
|
|
baseUrl: string;
|
|
|
|
standardEmojiStyle: object;
|
|
|
|
customEmojiStyle: object;
|
2022-02-17 15:27:01 +00:00
|
|
|
getCustomEmoji: TGetCustomEmoji;
|
2021-09-13 20:41:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMessageThread {
|
2022-03-02 14:18:01 +00:00
|
|
|
msg?: string;
|
|
|
|
tcount?: number;
|
2021-09-13 20:41:05 +00:00
|
|
|
theme: string;
|
2022-03-02 14:18:01 +00:00
|
|
|
tlm?: Date;
|
2021-09-13 20:41:05 +00:00
|
|
|
isThreadRoom: boolean;
|
|
|
|
id: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMessageTouchable {
|
|
|
|
hasError: boolean;
|
|
|
|
isInfo: boolean;
|
|
|
|
isThreadReply: boolean;
|
|
|
|
isTemp: boolean;
|
|
|
|
archived: boolean;
|
|
|
|
highlighted: boolean;
|
|
|
|
theme: string;
|
|
|
|
ts?: any;
|
|
|
|
urls?: any;
|
|
|
|
reactions?: any;
|
|
|
|
alias?: any;
|
|
|
|
role?: any;
|
|
|
|
drid?: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMessageRepliedThread {
|
2022-03-02 14:18:01 +00:00
|
|
|
tmid?: string;
|
|
|
|
tmsg?: string;
|
2021-09-13 20:41:05 +00:00
|
|
|
id: string;
|
|
|
|
isHeader: boolean;
|
|
|
|
theme: string;
|
|
|
|
fetchThreadName: Function;
|
|
|
|
isEncrypted: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMessageInner
|
|
|
|
extends IMessageDiscussion,
|
|
|
|
IMessageContent,
|
|
|
|
IMessageCallButton,
|
|
|
|
IMessageBlocks,
|
|
|
|
IMessageThread,
|
|
|
|
IMessageAttachments,
|
|
|
|
IMessageBroadcast {
|
2022-01-24 18:35:06 +00:00
|
|
|
type: TMessageType;
|
2021-09-13 20:41:05 +00:00
|
|
|
blocks: [];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IMessage extends IMessageRepliedThread, IMessageInner {
|
|
|
|
isThreadReply: boolean;
|
|
|
|
isThreadSequential: boolean;
|
|
|
|
isInfo: boolean;
|
|
|
|
isTemp: boolean;
|
|
|
|
isHeader: boolean;
|
|
|
|
hasError: boolean;
|
|
|
|
style: any;
|
|
|
|
onLongPress: Function;
|
|
|
|
isReadReceiptEnabled: boolean;
|
2022-03-02 14:18:01 +00:00
|
|
|
unread?: boolean;
|
2021-09-13 20:41:05 +00:00
|
|
|
theme: string;
|
|
|
|
isIgnored: boolean;
|
|
|
|
}
|