import type React from 'react'; import type { ContactInfo, FriendApplicationInfo, GroupInfo, GroupApplicationInfo } from 'tuikit-atomicx-react/chat'; // Re-export core types for convenience export type { ContactInfo, FriendApplicationInfo, GroupInfo, GroupApplicationInfo }; export type ContactItem = ContactInfo | GroupInfo | FriendApplicationInfo | GroupApplicationInfo; export enum ContactItemType { FRIEND = 'friend', BLACK = 'black', GROUP = 'group', FRIEND_REQUEST = 'friendRequest', GROUP_REQUEST = 'groupRequest', SEARCH_USER = 'searchUser', SEARCH_GROUP = 'searchGroup', } export interface ContactGroupItem { type: ContactItemType; data: ContactItem; } export interface ContactLetterSection { key: string; title: string; count: number; items: ContactInfo[]; } export interface ContactGroup { key: string; type: ContactItemType; title: string; items: ContactItem[]; unreadCount?: number; count?: number; sections?: ContactLetterSection[]; showTotalCount?: boolean; isExpanded: boolean; } export interface CustomGroupConfig { title?: string; hidden?: boolean; order?: number; } export interface ContactGroupHeaderProps { data: ContactGroup; onClick: React.MouseEventHandler; } export interface ContactListProps { activeContactItem?: ContactGroupItem; enableSearch?: boolean; groupConfig?: Partial>; className?: string; style?: React.CSSProperties; searchPlaceholder?: string; /** * Placeholder for the ExactSearch input shown after the user taps the * "add friend/group" entry. Defaults to the ExactSearch built-in i18n. */ searchInputPlaceholder?: string; emptyText?: string; ContactItem?: React.ComponentType | undefined; ContactSearchComponent?: React.ComponentType | undefined; GroupHeader?: React.ComponentType | undefined; PlaceholderEmptyList?: React.ReactNode | undefined; onContactItemClick?: (item: ContactGroupItem) => void; onFriendApplicationAction?: (action: 'accept' | 'refuse', application: FriendApplicationInfo) => void; onGroupApplicationAction?: (action: 'accept' | 'refuse', application: GroupApplicationInfo) => void; } interface ContactInfoBaseProps { showActions?: boolean; onClose?: () => void; className?: string; style?: React.CSSProperties; } export interface ContactInfoProps extends ContactInfoBaseProps { contactItem?: ContactGroupItem | undefined; PlaceholderEmpty?: React.ReactNode | undefined; FriendInfoComponent?: React.ComponentType; GroupInfoComponent?: React.ComponentType; BlacklistInfoComponent?: React.ComponentType; FriendApplicationInfoComponent?: React.ComponentType; GroupApplicationInfoComponent?: React.ComponentType; SearchGroupInfoComponent?: React.ComponentType; SearchUserInfoComponent?: React.ComponentType; onSendMessage?: (friend: ContactInfo) => void; onDeleteFriend?: (friend: ContactInfo) => void; onUpdateFriendRemark?: (friend: ContactInfo, remark: string) => void; onAddToBlacklist?: (friend: ContactInfo) => void; onRemoveFromBlacklist?: (profile: ContactInfo) => void; onEnterGroup?: (group: GroupInfo) => void; onLeaveGroup?: (group: GroupInfo) => void; onDismissGroup?: (group: GroupInfo) => void; onFriendApplicationAction?: (action: 'accept' | 'refuse', application: FriendApplicationInfo) => void; onGroupApplicationAction?: (action: 'accept' | 'refuse', application: GroupApplicationInfo) => void; onAddFriend?: (user: ContactInfo, wording: string) => void; onJoinGroup?: (group: GroupInfo, note: string) => void; } export interface BlacklistInfoProps extends ContactInfoBaseProps { profile: ContactInfo; onRemoveFromBlacklist?: (profile: ContactInfo) => void; } export interface FriendApplicationInfoProps extends ContactInfoBaseProps { application: FriendApplicationInfo; onAccept?: (application: FriendApplicationInfo) => void; onRefuse?: (application: FriendApplicationInfo) => void; } export interface FriendInfoProps extends ContactInfoBaseProps { friend: ContactInfo; onSendMessage?: (friend: ContactInfo) => void; onDeleteFriend?: (friend: ContactInfo) => void; onAddToBlacklist?: (friend: ContactInfo) => void; onUpdateFriendRemark?: (friend: ContactInfo, remark: string) => void; } export interface GroupApplicationInfoProps extends ContactInfoBaseProps { application: GroupApplicationInfo; onAccept?: (application: GroupApplicationInfo) => void; onRefuse?: (application: GroupApplicationInfo) => void; } export interface GroupInfoProps extends ContactInfoBaseProps { group: GroupInfo; onEnterGroup?: (group: GroupInfo) => void; onLeaveGroup?: (group: GroupInfo) => void; onDismissGroup?: (group: GroupInfo) => void; } export interface SearchGroupInfoProps extends ContactInfoBaseProps { group: GroupInfo; onJoinGroup?: (group: GroupInfo, note: string) => void; } export interface SearchUserInfoProps extends ContactInfoBaseProps { user: ContactInfo; onAddFriend?: (user: ContactInfo, wording: string) => void; } export interface ContactListItemProps { contactItem: ContactGroupItem; activeContactItem?: ContactGroupItem | undefined; onClick?: (type: ContactItemType, item: ContactItem) => void; onFriendApplicationAction?: (action: 'accept' | 'refuse', application: FriendApplicationInfo) => void; onGroupApplicationAction?: (action: 'accept' | 'refuse', application: GroupApplicationInfo) => void; className?: string; style?: React.CSSProperties; } export interface BlacklistItemProps { profile: ContactInfo; isActive?: boolean; onClick?: (profile: ContactInfo) => void; className?: string; style?: React.CSSProperties; } export interface FriendApplicationItemProps { application: FriendApplicationInfo; isActive?: boolean; onClick?: (application: FriendApplicationInfo) => void; onAction?: (action: 'accept' | 'refuse', application: FriendApplicationInfo) => void; className?: string; style?: React.CSSProperties; } export interface FriendItemProps { friend: ContactInfo; isActive?: boolean; onClick?: (friend: ContactInfo) => void; className?: string; style?: React.CSSProperties; } export interface GroupApplicationItemProps { application: GroupApplicationInfo; isActive?: boolean; onClick?: (application: GroupApplicationInfo) => void; onAction?: (action: 'accept' | 'refuse', application: GroupApplicationInfo) => void; className?: string; style?: React.CSSProperties; } export interface GroupItemProps { group: GroupInfo; isActive?: boolean; onClick?: (group: GroupInfo) => void; className?: string; style?: React.CSSProperties; } export interface ContactSearchProps { className?: string; style?: React.CSSProperties; placeholder?: string; /** * Placeholder forwarded to the inner ExactSearch input. */ searchInputPlaceholder?: string; autoFocus?: boolean; onResultClick?: (item: ContactGroupItem) => void; onKeywordChange?: (keyword: string) => void; }