UNPKG

react-native-ajora

Version:

The most complete AI agent UI for React Native

110 lines (109 loc) 4.81 kB
import React, { RefObject } from "react"; import { ActionSheetOptions } from "@expo/react-native-action-sheet"; import { TextInput, StyleProp, TextStyle, ViewStyle } from "react-native"; import { LightboxProps } from "react-native-lightbox-v2"; import { ActionsProps, OnUploadProps } from "../Actions"; import { ComposerProps } from "../Composer"; import { InputToolbarProps } from "../InputToolbar"; import { LoadEarlierProps } from "../LoadEarlier"; import { MessageProps } from "../Message"; import { MessageImageProps } from "../MessageImage"; import { MessageTextProps } from "../MessageText"; import { HeaderProps, IMessage, LeftRightStyle } from "../types"; import { SendProps } from "../Send"; import { AnimatedList, ListViewProps, MessageContainerProps } from "../MessageContainer"; import { BubbleProps } from "../Bubble"; import { MessageActionsProps } from "../MessageActions"; import { Thread } from "../Thread/types"; export interface AjoraProps<TMessage extends IMessage> extends Partial<MessageContainerProps<TMessage>> { messageContainerRef?: RefObject<AnimatedList<TMessage>>; textInputRef?: RefObject<TextInput>; isThinking?: boolean; messagesContainerStyle?: StyleProp<ViewStyle>; text?: string; alignTop?: boolean; isScrollToBottomEnabled?: boolean; scrollToBottomStyle?: StyleProp<ViewStyle>; initialText?: string; placeholder?: string; disableComposer?: boolean; locale?: string; timeFormat?: string; dateFormat?: string; dateFormatCalendar?: object; loadEarlier?: boolean; isLoadingEarlier?: boolean; isKeyboardInternallyHandled?: boolean; showUserAvatar?: boolean; showAvatarForEveryMessage?: boolean; renderAvatarOnTop?: boolean; imageProps?: MessageImageProps<TMessage>; lightboxProps?: LightboxProps; bottomOffset?: number; focusOnInputWhenOpeningKeyboard?: boolean; minInputToolbarHeight?: number; listViewProps?: ListViewProps; textInputProps?: object; keyboardShouldPersistTaps?: "always" | "never" | "handled"; maxInputLength?: number; alwaysShowSend?: boolean; imageStyle?: StyleProp<ViewStyle>; extraData?: object; minComposerHeight?: number; maxComposerHeight?: number; options?: { [key: string]: () => void; }; optionTintColor?: string; isCustomViewBottom?: boolean; infiniteScroll?: boolean; timeTextStyle?: LeftRightStyle<TextStyle>; actionSheet?(): { showActionSheetWithOptions: (options: ActionSheetOptions, callback: (buttonIndex: number) => void | Promise<void>) => void; }; messageIdGenerator?(message?: TMessage): string; onSend?(messages: TMessage[]): void; onLoadEarlier?(): void; renderLoading?(): React.ReactNode; renderLoadEarlier?(props: LoadEarlierProps): React.ReactNode; renderBubble?(props: BubbleProps<TMessage>): React.ReactNode; onPress?(context: unknown, message: TMessage): void; onLongPress?(context: unknown, message: TMessage): void; renderMessage?(message: MessageProps<TMessage>): React.ReactElement; renderMessageText?(messageText: MessageTextProps<TMessage>): React.ReactNode; renderMessageImage?(props: MessageImageProps<TMessage>): React.ReactNode; renderCustomView?(props: BubbleProps<TMessage>): React.ReactNode; renderHeader?(props: HeaderProps): React.ReactNode; renderThread?(props: Thread): React.ReactNode; renderFooter?(props: MessageContainerProps<TMessage>): React.ReactNode; renderChatEmpty?(): React.ReactNode; renderChatFooter?(): React.ReactNode; renderInputToolbar?(props: InputToolbarProps<TMessage>): React.ReactNode; renderComposer?(props: ComposerProps): React.ReactNode; renderActions?(props: ActionsProps): React.ReactNode; renderSend?(props: SendProps<TMessage>): React.ReactNode; renderMessageActions?(props: MessageActionsProps): React.ReactNode; renderAttachment?(): React.ReactNode; renderAccessory?(props: InputToolbarProps<TMessage>): React.ReactNode; tools?(): any[]; onPressActionButton?(): void; onInputTextChanged?(text: string): void; parsePatterns?: (linkStyle?: TextStyle) => { type?: string; pattern?: RegExp; style?: StyleProp<TextStyle> | object; onPress?: unknown; renderText?: unknown; }[]; scrollToBottomComponent?(): React.ReactNode; shouldUpdateMessage?(props: MessageProps<TMessage>, nextProps: MessageProps<TMessage>): boolean; showHeader?: boolean; headerProps?: Partial<HeaderProps>; showThreads?: boolean; threadProps?: Partial<Thread>; onThreadSelect?(thread: Thread): void; onNewThread?(): void; onHeaderLeftPress?(): void; onHeaderRightPress?(): void; onUpload?(props: OnUploadProps): Promise<void>; }