import React from 'react'; import { ActionSheetOptions } from '@expo/react-native-action-sheet'; import { FlatList, StyleProp, TextInput, TextStyle, ViewStyle } from 'react-native'; import { LightboxProps } from 'react-native-lightbox-v2'; import { Actions, ActionsProps } from './Actions'; import { Avatar, AvatarProps } from './Avatar'; import Bubble from './Bubble'; import { Composer, ComposerProps } from './Composer'; import { Day, DayProps } from './Day'; import { GiftedAvatar } from './GiftedAvatar'; import { InputToolbar, InputToolbarProps } from './InputToolbar'; import { LoadEarlier, LoadEarlierProps } from './LoadEarlier'; import Message from './Message'; import MessageContainer from './MessageContainer'; import { MessageImage, MessageImageProps } from './MessageImage'; import { MessageText, MessageTextProps } from './MessageText'; import { IMessage, LeftRightStyle, MessageAudioProps, MessageVideoProps, Reply, User } from './Models'; import { QuickRepliesProps } from './QuickReplies'; import { Send, SendProps } from './Send'; import { SystemMessage, SystemMessageProps } from './SystemMessage'; import { Time, TimeProps } from './Time'; import * as utils from './utils'; export interface GiftedChatProps { messageContainerRef?: React.RefObject>; textInputRef?: React.RefObject; messages?: TMessage[]; isTyping?: boolean; renderUsernameOnMessage?: boolean; messagesContainerStyle?: StyleProp; text?: string; alignTop?: boolean; scrollToBottom?: boolean; scrollToBottomStyle?: StyleProp; initialText?: string; placeholder?: string; disableComposer?: boolean; user?: User; locale?: string; timeFormat?: string; dateFormat?: string; loadEarlier?: boolean; isLoadingEarlier?: boolean; showUserAvatar?: boolean; showAvatarForEveryMessage?: boolean; renderAvatarOnTop?: boolean; inverted?: boolean; imageProps?: Message['props']; lightboxProps?: LightboxProps; bottomOffset?: number; minInputToolbarHeight?: number; listViewProps?: object; textInputProps?: object; keyboardShouldPersistTaps?: 'always' | 'never' | 'handled'; maxInputLength?: number; alwaysShowSend?: boolean; imageStyle?: StyleProp; extraData?: object; minComposerHeight?: number; maxComposerHeight?: number; options?: { [key: string]: () => void; }; optionTintColor?: string; quickReplyStyle?: StyleProp; quickReplyTextStyle?: StyleProp; quickReplyContainerStyle?: StyleProp; isCustomViewBottom?: boolean; infiniteScroll?: boolean; timeTextStyle?: LeftRightStyle; /** If you use translucent status bar on Android, set this option to true. Ignored on iOS. */ isStatusBarTranslucentAndroid?: boolean; actionSheet?(): { showActionSheetWithOptions: (options: ActionSheetOptions, callback: (buttonIndex: number) => void | Promise) => void; }; onPressAvatar?(user: User): void; onLongPressAvatar?(user: User): void; messageIdGenerator?(message?: TMessage): string; onSend?(messages: TMessage[]): void; onLoadEarlier?(): void; renderLoading?(): React.ReactNode; renderLoadEarlier?(props: LoadEarlierProps): React.ReactNode; renderAvatar?: null | ((props: AvatarProps) => React.ReactNode); renderBubble?(props: Bubble['props']): React.ReactNode; renderSystemMessage?(props: SystemMessageProps): React.ReactNode; onPress?(context: unknown, message: TMessage): void; onLongPress?(context: unknown, message: TMessage): void; renderUsername?(user: User): React.ReactNode; renderMessage?(message: Message['props']): React.ReactElement; renderMessageText?(messageText: MessageTextProps): React.ReactNode; renderMessageImage?(props: MessageImageProps): React.ReactNode; renderMessageVideo?(props: MessageVideoProps): React.ReactNode; renderMessageAudio?(props: MessageAudioProps): React.ReactNode; renderCustomView?(props: Bubble['props']): React.ReactNode; renderDay?(props: DayProps): React.ReactNode; renderTime?(props: TimeProps): React.ReactNode; renderFooter?(): React.ReactNode; renderChatEmpty?(): React.ReactNode; renderChatFooter?(): React.ReactNode; renderInputToolbar?(props: InputToolbarProps): React.ReactNode; renderComposer?(props: ComposerProps): React.ReactNode; renderActions?(props: ActionsProps): React.ReactNode; renderSend?(props: SendProps): React.ReactNode; renderAccessory?(props: InputToolbarProps): React.ReactNode; onPressActionButton?(): void; onInputTextChanged?(text: string): void; parsePatterns?: (linkStyle?: TextStyle) => { type?: string; pattern?: RegExp; style?: StyleProp | object; onPress?: unknown; renderText?: unknown; }[]; onQuickReply?(replies: Reply[]): void; renderQuickReplies?(quickReplies: QuickRepliesProps): React.ReactNode; renderQuickReplySend?(): React.ReactNode; scrollToBottomComponent?(): React.ReactNode; shouldUpdateMessage?(props: Message['props'], nextProps: Message['props']): boolean; } declare function GiftedChat(props: GiftedChatProps): React.JSX.Element; declare namespace GiftedChat { var append: (currentMessages: TMessage[] | undefined, messages: TMessage[], inverted?: boolean) => TMessage[]; var prepend: (currentMessages: TMessage[] | undefined, messages: TMessage[], inverted?: boolean) => TMessage[]; } export * from './Models'; export { GiftedChat, Actions, Avatar, Bubble, SystemMessage, MessageImage, MessageText, Composer, Day, InputToolbar, LoadEarlier, Message, MessageContainer, Send, Time, GiftedAvatar, utils };