Compare commits
1 Commits
develop
...
chore.ts-d
Author | SHA1 | Date |
---|---|---|
Reinaldo Neto | 51d95e1587 |
|
@ -13,6 +13,7 @@ import { themes } from '../../constants/colors';
|
||||||
import MessageContext from './Context';
|
import MessageContext from './Context';
|
||||||
import { fileDownloadAndPreview } from '../../utils/fileDownload';
|
import { fileDownloadAndPreview } from '../../utils/fileDownload';
|
||||||
import { formatAttachmentUrl } from '../../lib/utils';
|
import { formatAttachmentUrl } from '../../lib/utils';
|
||||||
|
import { IAttachment } from '../../definitions/IAttachment';
|
||||||
import RCActivityIndicator from '../ActivityIndicator';
|
import RCActivityIndicator from '../ActivityIndicator';
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
|
@ -90,43 +91,26 @@ const styles = StyleSheet.create({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
interface IMessageReplyAttachment {
|
|
||||||
author_name: string;
|
|
||||||
message_link: string;
|
|
||||||
ts: string;
|
|
||||||
text: string;
|
|
||||||
title: string;
|
|
||||||
short: boolean;
|
|
||||||
value: string;
|
|
||||||
title_link: string;
|
|
||||||
author_link: string;
|
|
||||||
type: string;
|
|
||||||
color: string;
|
|
||||||
description: string;
|
|
||||||
fields: IMessageReplyAttachment[];
|
|
||||||
thumb_url: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IMessageTitle {
|
interface IMessageTitle {
|
||||||
attachment: Partial<IMessageReplyAttachment>;
|
attachment: IAttachment;
|
||||||
timeFormat: string;
|
timeFormat: string;
|
||||||
theme: string;
|
theme: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IMessageDescription {
|
interface IMessageDescription {
|
||||||
attachment: Partial<IMessageReplyAttachment>;
|
attachment: IAttachment;
|
||||||
getCustomEmoji: Function;
|
getCustomEmoji: Function;
|
||||||
theme: string;
|
theme: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IMessageFields {
|
interface IMessageFields {
|
||||||
attachment: Partial<IMessageReplyAttachment>;
|
attachment: IAttachment;
|
||||||
theme: string;
|
theme: string;
|
||||||
getCustomEmoji: Function;
|
getCustomEmoji: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IMessageReply {
|
interface IMessageReply {
|
||||||
attachment: IMessageReplyAttachment;
|
attachment: IAttachment;
|
||||||
timeFormat: string;
|
timeFormat: string;
|
||||||
index: number;
|
index: number;
|
||||||
theme: string;
|
theme: string;
|
||||||
|
@ -198,7 +182,7 @@ const Fields = React.memo(
|
||||||
<Text style={[styles.fieldTitle, { color: themes[theme].bodyText }]}>{field.title}</Text>
|
<Text style={[styles.fieldTitle, { color: themes[theme].bodyText }]}>{field.title}</Text>
|
||||||
{/* @ts-ignore*/}
|
{/* @ts-ignore*/}
|
||||||
<Markdown
|
<Markdown
|
||||||
msg={field.value}
|
msg={field.value!}
|
||||||
baseUrl={baseUrl}
|
baseUrl={baseUrl}
|
||||||
username={user.username}
|
username={user.username}
|
||||||
getCustomEmoji={getCustomEmoji}
|
getCustomEmoji={getCustomEmoji}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import { fileDownload } from '../../utils/fileDownload';
|
||||||
import EventEmitter from '../../utils/events';
|
import EventEmitter from '../../utils/events';
|
||||||
import { LISTENER } from '../Toast';
|
import { LISTENER } from '../Toast';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
|
import { IAttachment } from '../../definitions/IAttachment';
|
||||||
import RCActivityIndicator from '../ActivityIndicator';
|
import RCActivityIndicator from '../ActivityIndicator';
|
||||||
|
|
||||||
const SUPPORTED_TYPES = ['video/quicktime', 'video/mp4', ...(isIOS ? [] : ['video/3gp', 'video/mkv'])];
|
const SUPPORTED_TYPES = ['video/quicktime', 'video/mp4', ...(isIOS ? [] : ['video/3gp', 'video/mkv'])];
|
||||||
|
@ -30,14 +31,7 @@ const styles = StyleSheet.create({
|
||||||
});
|
});
|
||||||
|
|
||||||
interface IMessageVideo {
|
interface IMessageVideo {
|
||||||
file: {
|
file: IAttachment;
|
||||||
title: string;
|
|
||||||
title_link: string;
|
|
||||||
type: string;
|
|
||||||
video_type: string;
|
|
||||||
video_url: string;
|
|
||||||
description: string;
|
|
||||||
};
|
|
||||||
showAttachment: Function;
|
showAttachment: Function;
|
||||||
getCustomEmoji: Function;
|
getCustomEmoji: Function;
|
||||||
theme: string;
|
theme: string;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
export interface IAttachment {
|
export interface IAttachment {
|
||||||
|
ts: Date;
|
||||||
title: string;
|
title: string;
|
||||||
type: string;
|
type: string;
|
||||||
description: string;
|
description: string;
|
||||||
|
@ -7,4 +8,18 @@ export interface IAttachment {
|
||||||
image_type?: string;
|
image_type?: string;
|
||||||
video_url?: string;
|
video_url?: string;
|
||||||
video_type?: string;
|
video_type?: string;
|
||||||
|
title_link_download?: boolean;
|
||||||
|
fields?: IAttachment[];
|
||||||
|
image_dimensions?: { width?: number; height?: number };
|
||||||
|
image_preview?: string;
|
||||||
|
image_size?: number;
|
||||||
|
author_name?: string;
|
||||||
|
author_icon?: string;
|
||||||
|
message_link?: string;
|
||||||
|
text?: string;
|
||||||
|
short?: boolean;
|
||||||
|
value?: string;
|
||||||
|
author_link?: string;
|
||||||
|
color?: string;
|
||||||
|
thumb_url?: string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,71 @@
|
||||||
|
import Model from '@nozbe/watermelondb/Model';
|
||||||
|
import { MarkdownAST } from '@rocket.chat/message-parser';
|
||||||
|
|
||||||
|
import { IAttachment } from './IAttachment';
|
||||||
|
import { IReaction } from './IReactions';
|
||||||
|
import { RoomType } from './IRoom';
|
||||||
|
|
||||||
|
interface IUserMessage {
|
||||||
|
_id: string;
|
||||||
|
username?: string;
|
||||||
|
name?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IUserMention extends IUserMessage {
|
||||||
|
type: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IUserChannel {
|
||||||
|
[index: number]: string | number;
|
||||||
|
name: string;
|
||||||
|
_id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type TOnLinkPress = (link: string) => void;
|
||||||
|
|
||||||
|
export interface ITranslations {
|
||||||
|
_id: string;
|
||||||
|
language: string;
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface IMessage {
|
export interface IMessage {
|
||||||
msg: string;
|
msg: string;
|
||||||
|
t?: RoomType;
|
||||||
|
ts: Date;
|
||||||
|
u: IUserMessage;
|
||||||
|
subscription: { id: string };
|
||||||
|
alias: string;
|
||||||
|
parseUrls: boolean;
|
||||||
|
groupable: boolean;
|
||||||
|
avatar: string;
|
||||||
|
emoji: string;
|
||||||
|
attachments: IAttachment[];
|
||||||
|
urls: string[];
|
||||||
|
_updatedAt: Date;
|
||||||
|
status: number;
|
||||||
|
pinned: boolean;
|
||||||
|
starred: boolean;
|
||||||
|
editedBy?: { _id: string; username: string };
|
||||||
|
reactions: IReaction[];
|
||||||
|
role: string;
|
||||||
|
drid: string;
|
||||||
|
dcount: number;
|
||||||
|
dlm: Date;
|
||||||
|
tmid: string;
|
||||||
|
tcount: number;
|
||||||
|
tlm: Date;
|
||||||
|
replies: string[];
|
||||||
|
mentions: IUserMention[];
|
||||||
|
channels: IUserChannel[];
|
||||||
|
unread: boolean;
|
||||||
|
autoTranslate: boolean;
|
||||||
|
translations: ITranslations[];
|
||||||
|
tmsg: string;
|
||||||
|
blocks: any;
|
||||||
|
e2e: string;
|
||||||
|
tshow: boolean;
|
||||||
|
md: MarkdownAST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type TMessageModel = IMessage & Model;
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
export interface IReaction {
|
||||||
|
_id: string;
|
||||||
|
emoji: string;
|
||||||
|
usernames: string[];
|
||||||
|
}
|
Loading…
Reference in New Issue