import React, { ComponentProps } from 'react' import { StyleProp, ViewStyle, TextStyle, Pressable, } from 'react-native' import { MessageReplyProps } from '../components/MessageReply' import { MessageImageProps } from '../MessageImage' import { MessageTextProps } from '../MessageText' import { User, IMessage, LeftRightStyle, Reply, ReplyMessage, Omit, MessageVideoProps, MessageAudioProps, } from '../Models' import { QuickRepliesProps } from '../QuickReplies' import { MessageReplyStyleProps } from '../Reply' import { TimeProps } from '../Time' export type RenderMessageImageProps = Omit< BubbleProps, 'containerStyle' | 'wrapperStyle' > & MessageImageProps export type RenderMessageVideoProps = Omit< BubbleProps, 'containerStyle' | 'wrapperStyle' > & MessageVideoProps export type RenderMessageAudioProps = Omit< BubbleProps, 'containerStyle' | 'wrapperStyle' > & MessageAudioProps export type RenderMessageTextProps = Omit< BubbleProps, 'containerStyle' | 'wrapperStyle' > & MessageTextProps /** Props for message reply functionality in bubble */ export interface BubbleReplyProps extends MessageReplyStyleProps { /** Custom render for message reply; rendered on top of message content */ renderMessageReply?: (props: MessageReplyProps) => React.ReactNode /** Callback when message reply is pressed */ onPress?: (replyMessage: ReplyMessage) => void } export interface BubbleProps { user?: User touchableProps?: ComponentProps isUsernameVisible?: boolean isCustomViewBottom?: boolean isInverted?: boolean position: 'left' | 'right' currentMessage: TMessage nextMessage?: TMessage previousMessage?: TMessage containerStyle?: LeftRightStyle wrapperStyle?: LeftRightStyle textStyle?: LeftRightStyle bottomContainerStyle?: LeftRightStyle tickStyle?: StyleProp containerToNextStyle?: LeftRightStyle containerToPreviousStyle?: LeftRightStyle usernameStyle?: TextStyle quickReplyStyle?: StyleProp quickReplyTextStyle?: StyleProp quickReplyContainerStyle?: StyleProp messageTextProps?: Partial> onPressMessage?: (context?: unknown, message?: unknown) => void onLongPressMessage?: (context?: unknown, message?: unknown) => void onQuickReply?: (replies: Reply[]) => void renderMessageImage?: ( props: RenderMessageImageProps ) => React.ReactNode renderMessageVideo?: ( props: RenderMessageVideoProps ) => React.ReactNode renderMessageAudio?: ( props: RenderMessageAudioProps ) => React.ReactNode renderMessageText?: (props: RenderMessageTextProps) => React.ReactNode renderCustomView?: (bubbleProps: BubbleProps) => React.ReactNode renderTime?: (timeProps: TimeProps) => React.ReactNode renderTicks?: (currentMessage: TMessage) => React.ReactNode renderUsername?: (user?: TMessage['user']) => React.ReactNode renderQuickReplySend?: () => React.ReactNode renderQuickReplies?: ( quickReplies: QuickRepliesProps ) => React.ReactNode /** Message reply configuration */ messageReply?: BubbleReplyProps }