import React, { RefObject } from 'react'; import PropTypes from 'prop-types'; import { FlatList, ListRenderItemInfo, NativeSyntheticEvent, NativeScrollEvent, StyleProp, ViewStyle } from 'react-native'; import { LoadEarlierProps } from './LoadEarlier'; import Message from './Message'; import { User, IMessage, Reply } from './Models'; export interface MessageContainerProps { messages?: TMessage[]; isTyping?: boolean; user?: User; listViewProps: object; inverted?: boolean; loadEarlier?: boolean; alignTop?: boolean; scrollToBottom?: boolean; scrollToBottomStyle?: StyleProp; invertibleScrollViewProps?: object; extraData?: object; scrollToBottomOffset?: number; forwardRef?: RefObject>; renderChatEmpty?(): React.ReactNode; renderFooter?(props: MessageContainerProps): React.ReactNode; renderMessage?(props: Message['props']): React.ReactElement; renderLoadEarlier?(props: LoadEarlierProps): React.ReactNode; scrollToBottomComponent?(): React.ReactNode; onLoadEarlier?(): void; onQuickReply?(replies: Reply[]): void; infiniteScroll?: boolean; isLoadingEarlier?: boolean; } interface State { showScrollBottom: boolean; hasScrolled: boolean; } export default class MessageContainer extends React.PureComponent, State> { static defaultProps: { messages: never[]; user: {}; isTyping: boolean; renderChatEmpty: null; renderFooter: null; renderMessage: null; onLoadEarlier: () => void; onQuickReply: () => void; inverted: boolean; loadEarlier: boolean; listViewProps: {}; invertibleScrollViewProps: {}; extraData: null; scrollToBottom: boolean; scrollToBottomOffset: number; alignTop: boolean; scrollToBottomStyle: {}; infiniteScroll: boolean; isLoadingEarlier: boolean; }; static propTypes: { messages: PropTypes.Requireable<(object | null | undefined)[]>; isTyping: PropTypes.Requireable; user: PropTypes.Requireable; renderChatEmpty: PropTypes.Requireable<(...args: any[]) => any>; renderFooter: PropTypes.Requireable<(...args: any[]) => any>; renderMessage: PropTypes.Requireable<(...args: any[]) => any>; renderLoadEarlier: PropTypes.Requireable<(...args: any[]) => any>; onLoadEarlier: PropTypes.Requireable<(...args: any[]) => any>; listViewProps: PropTypes.Requireable; inverted: PropTypes.Requireable; loadEarlier: PropTypes.Requireable; invertibleScrollViewProps: PropTypes.Requireable; extraData: PropTypes.Requireable; scrollToBottom: PropTypes.Requireable; scrollToBottomOffset: PropTypes.Requireable; scrollToBottomComponent: PropTypes.Requireable<(...args: any[]) => any>; alignTop: PropTypes.Requireable; scrollToBottomStyle: PropTypes.Requireable>; infiniteScroll: PropTypes.Requireable; }; state: { showScrollBottom: boolean; hasScrolled: boolean; }; renderTypingIndicator: () => React.JSX.Element; renderFooter: () => string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderLoadEarlier: () => string | number | boolean | React.JSX.Element | Iterable | null | undefined; scrollTo(options: { animated?: boolean; offset: number; }): void; scrollToBottom: (animated?: boolean) => void; handleOnScroll: (event: NativeSyntheticEvent) => void; renderRow: ({ item, index }: ListRenderItemInfo) => React.ReactElement | null; renderChatEmpty: () => string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderHeaderWrapper: () => React.JSX.Element; renderScrollBottomComponent(): string | number | boolean | React.JSX.Element | Iterable | null | undefined; renderScrollToBottomWrapper(): React.JSX.Element; onLayoutList: () => void; onEndReached: ({ distanceFromEnd }: { distanceFromEnd: number; }) => void; keyExtractor: (item: TMessage) => string; render(): React.JSX.Element; } export {};