2022-04-20 21:37:54 +00:00
|
|
|
import React from 'react';
|
2022-06-06 13:23:49 +00:00
|
|
|
import Animated from 'react-native-reanimated';
|
2022-04-20 21:37:54 +00:00
|
|
|
|
|
|
|
import { TSupportedThemes } from '../../theme';
|
|
|
|
import { TUserStatus, ILastMessage, SubscriptionType, IOmnichannelSource } from '../../definitions';
|
|
|
|
|
|
|
|
export interface ILeftActionsProps {
|
2022-06-06 13:23:49 +00:00
|
|
|
transX: Animated.SharedValue<number>;
|
2022-04-20 21:37:54 +00:00
|
|
|
isRead: boolean;
|
|
|
|
width: number;
|
|
|
|
onToggleReadPress(): void;
|
|
|
|
displayMode: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IRightActionsProps {
|
2022-06-06 13:23:49 +00:00
|
|
|
transX: Animated.SharedValue<number>;
|
2022-04-20 21:37:54 +00:00
|
|
|
favorite: boolean;
|
|
|
|
width: number;
|
|
|
|
toggleFav(): void;
|
|
|
|
onHidePress(): void;
|
|
|
|
displayMode: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ITitleProps {
|
|
|
|
name: string;
|
|
|
|
hideUnreadStatus: boolean;
|
|
|
|
alert: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IUpdatedAtProps {
|
|
|
|
date: string;
|
|
|
|
hideUnreadStatus: boolean;
|
|
|
|
alert: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IWrapperProps {
|
|
|
|
accessibilityLabel: string;
|
|
|
|
avatar: string;
|
|
|
|
type: string;
|
|
|
|
rid: string;
|
|
|
|
children: React.ReactElement;
|
|
|
|
displayMode: string;
|
|
|
|
prid: string;
|
|
|
|
showLastMessage: boolean;
|
2022-06-27 18:23:43 +00:00
|
|
|
status: TUserStatus;
|
2022-04-20 21:37:54 +00:00
|
|
|
isGroupChat: boolean;
|
|
|
|
teamMain: boolean;
|
|
|
|
showAvatar: boolean;
|
|
|
|
sourceType: IOmnichannelSource;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ITypeIconProps {
|
|
|
|
type: string;
|
|
|
|
status: TUserStatus;
|
|
|
|
prid: string;
|
|
|
|
isGroupChat: boolean;
|
|
|
|
teamMain: boolean;
|
|
|
|
theme?: TSupportedThemes;
|
|
|
|
size?: number;
|
|
|
|
style?: object;
|
|
|
|
sourceType: IOmnichannelSource;
|
|
|
|
}
|
|
|
|
|
2022-06-27 18:23:43 +00:00
|
|
|
interface IRoomItemTouchables {
|
|
|
|
toggleFav?: (rid: string, favorite: boolean) => Promise<void>;
|
|
|
|
toggleRead?: (rid: string, tIsRead: boolean) => Promise<void>;
|
|
|
|
hideChannel?: (rid: string, type: SubscriptionType) => Promise<void>;
|
|
|
|
onPress: (item?: any) => void;
|
|
|
|
onLongPress?: (item?: any) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IBaseRoomItem extends IRoomItemTouchables {
|
|
|
|
[key: string]: any;
|
|
|
|
showLastMessage?: boolean;
|
2022-04-20 21:37:54 +00:00
|
|
|
useRealName: boolean;
|
2022-06-27 18:23:43 +00:00
|
|
|
isFocused?: boolean;
|
|
|
|
displayMode: string;
|
|
|
|
showAvatar: boolean;
|
|
|
|
swipeEnabled: boolean;
|
|
|
|
autoJoin?: boolean;
|
|
|
|
username?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IRoomItemContainerProps extends IBaseRoomItem {
|
|
|
|
item: any;
|
|
|
|
id?: string;
|
2022-04-20 21:37:54 +00:00
|
|
|
getRoomTitle: (item: any) => string;
|
|
|
|
getRoomAvatar: (item: any) => string;
|
2022-06-27 18:23:43 +00:00
|
|
|
getIsRead?: (item: any) => boolean;
|
2022-04-20 21:37:54 +00:00
|
|
|
}
|
|
|
|
|
2022-06-27 18:23:43 +00:00
|
|
|
export interface IRoomItemProps extends IBaseRoomItem {
|
2022-04-20 21:37:54 +00:00
|
|
|
rid: string;
|
|
|
|
type: SubscriptionType;
|
|
|
|
prid: string;
|
|
|
|
name: string;
|
|
|
|
avatar: string;
|
|
|
|
testID: string;
|
|
|
|
status: TUserStatus;
|
|
|
|
isGroupChat: boolean;
|
|
|
|
isRead: boolean;
|
|
|
|
teamMain: boolean;
|
|
|
|
date: string;
|
|
|
|
accessibilityLabel: string;
|
|
|
|
lastMessage: ILastMessage;
|
|
|
|
favorite: boolean;
|
|
|
|
alert: boolean;
|
|
|
|
hideUnreadStatus: boolean;
|
|
|
|
unread: number;
|
|
|
|
userMentions: number;
|
|
|
|
groupMentions: number;
|
|
|
|
tunread: [];
|
|
|
|
tunreadUser: [];
|
|
|
|
tunreadGroup: [];
|
|
|
|
size?: number;
|
|
|
|
sourceType: IOmnichannelSource;
|
2022-06-13 13:24:54 +00:00
|
|
|
hideMentionStatus?: boolean;
|
2022-12-13 18:53:04 +00:00
|
|
|
touchableRef: React.RefObject<ITouchableRef>;
|
2022-04-20 21:37:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ILastMessageProps {
|
|
|
|
lastMessage: ILastMessage;
|
|
|
|
type: SubscriptionType;
|
|
|
|
showLastMessage: boolean;
|
|
|
|
username: string;
|
|
|
|
useRealName: boolean;
|
|
|
|
alert: boolean;
|
|
|
|
}
|
|
|
|
|
2022-12-13 18:53:04 +00:00
|
|
|
export interface ITouchableRef {
|
|
|
|
close: () => void;
|
|
|
|
}
|
|
|
|
|
2022-06-27 18:23:43 +00:00
|
|
|
export interface ITouchableProps extends IRoomItemTouchables {
|
2022-04-20 21:37:54 +00:00
|
|
|
children: JSX.Element;
|
2022-06-27 18:23:43 +00:00
|
|
|
type: SubscriptionType;
|
2022-04-20 21:37:54 +00:00
|
|
|
testID: string;
|
|
|
|
favorite: boolean;
|
|
|
|
isRead: boolean;
|
|
|
|
rid: string;
|
|
|
|
isFocused: boolean;
|
|
|
|
swipeEnabled: boolean;
|
|
|
|
displayMode: string;
|
|
|
|
}
|
2022-06-27 18:23:43 +00:00
|
|
|
|
|
|
|
export interface IIconOrAvatar {
|
|
|
|
avatar: string;
|
|
|
|
type: string;
|
|
|
|
rid: string;
|
|
|
|
showAvatar: boolean;
|
|
|
|
displayMode: string;
|
|
|
|
prid: string;
|
|
|
|
status: TUserStatus;
|
|
|
|
isGroupChat: boolean;
|
|
|
|
teamMain: boolean;
|
|
|
|
showLastMessage: boolean;
|
|
|
|
sourceType: IOmnichannelSource;
|
|
|
|
}
|