softchatjs-react-native
Version:
React native UI SDK for softchatjs-core. Create a free account at: https://www.softchatjs.com
44 lines (41 loc) • 1.39 kB
text/typescript
import React, { MutableRefObject } from 'react';
import { View } from 'react-native';
import { Prettify, ChatBubbleRenderProps, ChatInputRenderProps, ChatHeaderRenderProps, Children } from '../../types.mjs';
import { ConversationListItem, Message } from 'softchatjs-core';
type ChatProps = {
/**
* Active conversation is the current conversation the user is actively engaged in
*/
activeConversation: ConversationListItem;
/**
* Render a custom chat item
*/
renderChatBubble?: (props: Prettify<ChatBubbleRenderProps>) => void;
/**
* Render a customer chat input
*/
renderChatInput?: (props: Prettify<ChatInputRenderProps>) => void;
/**
* Render a custom chat header
*/
renderChatHeader?: (props: Prettify<ChatHeaderRenderProps>) => void;
/**
* Render a custom empty state when a user has no messages
*/
placeholder?: Children;
/**
* Value passed to adjust how the keyboard adjusts the input field when it's open
*/
keyboardOffset?: number;
};
type SendMessage = {
message: string;
};
type SelectedMessage = {
message: Message | null;
ref: MutableRefObject<View | undefined> | null;
itemIndex: number;
isMessageOwner: boolean;
};
declare function Chat(props: ChatProps): React.JSX.Element;
export { type SelectedMessage, type SendMessage, Chat as default };