import type { EmojiCategory, SendbirdError, User } from '@sendbird/chat'; import { type FileMessage, FileMessageCreateParams, type MultipleFilesMessage, MultipleFilesMessageCreateParams, UserMessageCreateParams, UserMessageUpdateParams } from '@sendbird/chat/message'; import type { GroupChannel, MessageCollectionParams, MessageFilterParams } from '@sendbird/chat/groupChannel'; import type { PubSubTypes } from '../../../lib/pubSub'; import type { ScrollTopics, ScrollTopicUnion } from './hooks/useMessageListScroll'; import type { SendableMessageType } from '../../../utils'; import type { UserProfileProviderProps } from '../../../lib/UserProfileContext'; import { ReplyType } from '../../../types'; import { useMessageActions } from './hooks/useMessageActions'; import { useGroupChannelMessages } from '@sendbird/uikit-tools'; import { ThreadReplySelectType } from './const'; import { PropsWithChildren } from 'react'; type MessageDataSource = ReturnType; export type MessageActions = ReturnType; export type MessageListQueryParamsType = Omit & MessageFilterParams; export type OnBeforeHandler = (params: T) => T | Promise | void | Promise; export type OnBeforeDownloadFileMessageType = (params: { message: FileMessage | MultipleFilesMessage; index?: number; }) => Promise; export interface GroupChannelState extends GroupChannelProviderProps, Omit { } interface InternalGroupChannelState extends MessageDataSource { currentChannel: GroupChannel | null; channelUrl: string; fetchChannelError: SendbirdError | null; nicknamesMap: Map; quoteMessage: SendableMessageType | null; animatedMessageId: number | null; isScrollBottomReached: boolean; readState: string | null; newMessageIds: number[] | null; scrollRef: React.RefObject; scrollDistanceFromBottomRef: React.MutableRefObject; scrollPositionRef: React.MutableRefObject; messageInputRef: React.RefObject; isReactionEnabled: boolean; isMessageGroupingEnabled: boolean; isMultipleFilesMessageEnabled: boolean; autoscrollMessageOverflowToTop: boolean; showSearchIcon: boolean; replyType: ReplyType; threadReplySelectType: ThreadReplySelectType; disableMarkAsRead: boolean; scrollBehavior: 'smooth' | 'auto'; markAsUnread?: (message: SendableMessageType) => void; markAsUnreadSourceRef: React.MutableRefObject<'manual' | 'internal' | null>; scrollPubSub: PubSubTypes; } export interface GroupChannelProviderProps extends PropsWithChildren> { channelUrl: string; isReactionEnabled?: boolean; isMessageGroupingEnabled?: boolean; isMultipleFilesMessageEnabled?: boolean; autoscrollMessageOverflowToTop?: boolean; showSearchIcon?: boolean; replyType?: ReplyType; threadReplySelectType?: ThreadReplySelectType; disableMarkAsRead?: boolean; scrollBehavior?: 'smooth' | 'auto'; forceLeftToRightMessageLayout?: boolean; startingPoint?: number; animatedMessageId?: number | null; onMessageAnimated?: () => void; messageListQueryParams?: MessageListQueryParamsType; filterEmojiCategoryIds?: (message: SendableMessageType) => EmojiCategory['id'][]; onBeforeSendUserMessage?: OnBeforeHandler; onBeforeSendFileMessage?: OnBeforeHandler; onBeforeSendVoiceMessage?: OnBeforeHandler; onBeforeSendMultipleFilesMessage?: OnBeforeHandler; onBeforeUpdateUserMessage?: OnBeforeHandler; onBeforeDownloadFileMessage?: OnBeforeDownloadFileMessageType; onBackClick?(): void; onChatHeaderActionClick?(event: React.MouseEvent): void; onReplyInThreadClick?: (props: { message: SendableMessageType; }) => void; onSearchClick?(): void; onQuoteMessageClick?: (props: { message: SendableMessageType; }) => void; renderUserMentionItem?: (props: { user: User; }) => JSX.Element; } export {};