import PropTypes from 'prop-types'; import React from 'react'; import { StyleProp, ViewStyle, TextStyle } from 'react-native'; import { QuickRepliesProps } from './QuickReplies'; import { MessageTextProps } from './MessageText'; import { MessageImageProps } from './MessageImage'; import { TimeProps } from './Time'; import { User, IMessage, LeftRightStyle, Reply, Omit, MessageVideoProps, MessageAudioProps } from './Models'; export type RenderMessageImageProps = Omit, 'containerStyle' | 'wrapperStyle'> & MessageImageProps; export type RenderMessageVideoProps = Omit, 'containerStyle' | 'wrapperStyle'> & MessageVideoProps; export type RenderMessageAudioProps = Omit, 'containerStyle' | 'wrapperStyle'> & MessageAudioProps; export type RenderMessageTextProps = Omit, 'containerStyle' | 'wrapperStyle'> & MessageTextProps; export interface BubbleProps { user?: User; touchableProps?: object; renderUsernameOnMessage?: boolean; isCustomViewBottom?: boolean; inverted?: boolean; position: 'left' | 'right'; currentMessage: TMessage; nextMessage?: TMessage; previousMessage?: TMessage; optionTitles?: string[]; containerStyle?: LeftRightStyle; wrapperStyle?: LeftRightStyle; textStyle?: LeftRightStyle; bottomContainerStyle?: LeftRightStyle; tickStyle?: StyleProp; containerToNextStyle?: LeftRightStyle; containerToPreviousStyle?: LeftRightStyle; usernameStyle?: TextStyle; quickReplyStyle?: StyleProp; quickReplyTextStyle?: StyleProp; quickReplyContainerStyle?: StyleProp; onPress?(context?: unknown, message?: unknown): void; onLongPress?(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; } export default class Bubble extends React.Component> { static contextType: React.Context; static defaultProps: { touchableProps: {}; onPress: null; onLongPress: null; renderMessageImage: null; renderMessageVideo: null; renderMessageAudio: null; renderMessageText: null; renderCustomView: null; renderUsername: null; renderTicks: null; renderTime: null; renderQuickReplies: null; onQuickReply: null; position: string; currentMessage: { text: null; createdAt: null; image: null; }; nextMessage: {}; previousMessage: {}; containerStyle: {}; wrapperStyle: {}; bottomContainerStyle: {}; tickStyle: {}; usernameStyle: {}; containerToNextStyle: {}; containerToPreviousStyle: {}; }; static propTypes: { user: PropTypes.Validator; touchableProps: PropTypes.Requireable; onLongPress: PropTypes.Requireable<(...args: any[]) => any>; renderMessageImage: PropTypes.Requireable<(...args: any[]) => any>; renderMessageVideo: PropTypes.Requireable<(...args: any[]) => any>; renderMessageAudio: PropTypes.Requireable<(...args: any[]) => any>; renderMessageText: PropTypes.Requireable<(...args: any[]) => any>; renderCustomView: PropTypes.Requireable<(...args: any[]) => any>; isCustomViewBottom: PropTypes.Requireable; renderUsernameOnMessage: PropTypes.Requireable; renderUsername: PropTypes.Requireable<(...args: any[]) => any>; renderTime: PropTypes.Requireable<(...args: any[]) => any>; renderTicks: PropTypes.Requireable<(...args: any[]) => any>; renderQuickReplies: PropTypes.Requireable<(...args: any[]) => any>; onQuickReply: PropTypes.Requireable<(...args: any[]) => any>; position: PropTypes.Requireable; optionTitles: PropTypes.Requireable<(string | null | undefined)[]>; currentMessage: PropTypes.Requireable; nextMessage: PropTypes.Requireable; previousMessage: PropTypes.Requireable; containerStyle: PropTypes.Requireable>; right: PropTypes.Requireable>; }>>; wrapperStyle: PropTypes.Requireable>; right: PropTypes.Requireable>; }>>; bottomContainerStyle: PropTypes.Requireable>; right: PropTypes.Requireable>; }>>; tickStyle: PropTypes.Requireable>; usernameStyle: PropTypes.Requireable>; containerToNextStyle: PropTypes.Requireable>; right: PropTypes.Requireable>; }>>; containerToPreviousStyle: PropTypes.Requireable>; right: PropTypes.Requireable>; }>>; }; onPress: () => void; onLongPress: () => void; styledBubbleToNext(): (StyleProp | { borderBottomLeftRadius: number; } | { borderBottomRightRadius: number; })[] | null; styledBubbleToPrevious(): (StyleProp | { borderTopLeftRadius: number; } | { borderTopRightRadius: number; })[] | null; renderQuickReplies(): string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderMessageText(): string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderMessageImage(): string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderMessageVideo(): string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderMessageAudio(): string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderTicks(): string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderTime(): string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderUsername(): string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderCustomView(): React.ReactNode; renderBubbleContent(): React.JSX.Element; render(): React.JSX.Element; }