creating the IThread interface

This commit is contained in:
AlexAlexandre 2021-12-14 23:09:30 -03:00
parent d649eb5f4e
commit 63a3e91fd9
5 changed files with 64 additions and 1 deletions

View File

@ -0,0 +1,6 @@
export interface IMention {
_id: string;
name: string;
username: string;
type: string;
}

View File

@ -0,0 +1,5 @@
export interface IReaction {
_id: string;
emoji: string;
usernames: string[];
}

View File

@ -0,0 +1,45 @@
import Model from '@nozbe/watermelondb/Model';
import { IAttachment } from './IAttachment';
import { IMention } from './IMention';
import { IReaction } from './IReaction';
import { RoomType } from './IRoom';
import { IUrl } from './IUrl';
export interface IThread {
id: string;
msg: string;
t: RoomType;
rid: string;
_updated_at: Date;
ts: Date;
u: { _id: string; username: string; name: string };
alias: any;
parse_urls: any;
groupable: boolean;
avatar: string;
emoji: any;
attachments: IAttachment[];
urls: IUrl[];
status: number;
pinned: null;
starred: null;
edited_by: { username: string };
reactions: IReaction[];
role: null;
drid: null;
dcount: null;
dlm: null;
tmid: string;
tcount: 2;
tlm: Date;
replies: string[];
mentions: IMention[];
channels: [];
unread: boolean;
auto_translate: boolean;
translations: any;
e2e: any;
}
export type TThreadModel = IThread & Model;

6
app/definitions/IUrl.ts Normal file
View File

@ -0,0 +1,6 @@
export interface IUrl {
title: string;
description: string;
image: string;
url: string;
}

View File

@ -21,6 +21,7 @@ import List from './List';
import NavBottomFAB from './NavBottomFAB';
import { ChatsStackParamList } from '../../../stacks/types';
import { IRoomItem } from '../index';
import { IThread } from '../../../definitions/IThread';
const QUERY_SIZE = 50;
@ -61,7 +62,7 @@ class ListContainer extends React.Component<IRoomListContainerProps, any> {
private unsubscribeFocus: any;
private viewabilityConfig: { itemVisiblePercentThreshold: number };
private highlightedMessageTimeout: any;
private thread: any;
private thread?: IThread;
private messagesObservable?: Observable<Model>;
private messagesSubscription?: Subscription;
private viewableItems: any;