import PropTypes from 'prop-types'; import React from 'react'; import { ViewStyle, LayoutChangeEvent } from 'react-native'; import { AvatarProps } from './Avatar'; import Bubble from './Bubble'; import { SystemMessageProps } from './SystemMessage'; import { DayProps } from './Day'; import { IMessage, User, LeftRightStyle } from './Models'; export interface MessageProps { showUserAvatar?: boolean; position: 'left' | 'right'; currentMessage: TMessage; nextMessage?: TMessage; previousMessage?: TMessage; user: User; inverted?: boolean; containerStyle?: LeftRightStyle; renderBubble?(props: Bubble['props']): React.ReactNode; renderDay?(props: DayProps): React.ReactNode; renderSystemMessage?(props: SystemMessageProps): React.ReactNode; renderAvatar?(props: AvatarProps): React.ReactNode; shouldUpdateMessage?(props: MessageProps, nextProps: MessageProps): boolean; onMessageLayout?(event: LayoutChangeEvent): void; } export default class Message extends React.Component> { static defaultProps: { renderAvatar: undefined; renderBubble: null; renderDay: null; renderSystemMessage: null; position: string; currentMessage: {}; nextMessage: {}; previousMessage: {}; user: {}; containerStyle: {}; showUserAvatar: boolean; inverted: boolean; shouldUpdateMessage: undefined; onMessageLayout: undefined; }; static propTypes: { renderAvatar: PropTypes.Requireable<(...args: any[]) => any>; showUserAvatar: PropTypes.Requireable; renderBubble: PropTypes.Requireable<(...args: any[]) => any>; renderDay: PropTypes.Requireable<(...args: any[]) => any>; renderSystemMessage: PropTypes.Requireable<(...args: any[]) => any>; position: PropTypes.Requireable; currentMessage: PropTypes.Requireable; nextMessage: PropTypes.Requireable; previousMessage: PropTypes.Requireable; user: PropTypes.Requireable; inverted: PropTypes.Requireable; containerStyle: PropTypes.Requireable>; right: PropTypes.Requireable>; }>>; shouldUpdateMessage: PropTypes.Requireable<(...args: any[]) => any>; onMessageLayout: PropTypes.Requireable<(...args: any[]) => any>; }; shouldComponentUpdate(nextProps: MessageProps): boolean; renderDay(): string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderBubble(): string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderSystemMessage(): string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderAvatar(): React.JSX.Element | null; render(): React.JSX.Element | null; }