@cometchat/chat-uikit-react-native
Version:
Ready-to-use Chat UI Components for React Native
87 lines (86 loc) • 2.41 kB
TypeScript
import React, { JSX, RefObject } from "react";
import { NativeSyntheticEvent, TextInputSelectionChangeEventData } from "react-native";
import { CometChatTheme } from "../../../theme/type";
/**
* Props for the CometChatMessageInput component.
*/
export interface CometChatMessageInputInterface {
/**
* Text for the input.
*
* @type {string}
*/
text?: string;
/**
* Placeholder text for the input.
*
* @type {string}
*/
placeHolderText?: string;
/**
* Callback function invoked when the input text changes.
*
* @param {string} newText - The new text entered.
*/
onChangeText?: (arg0: string) => void;
/**
* Custom style for the message input.
*/
style?: CometChatTheme["messageComposerStyles"]["messageInputStyles"];
/**
* Maximum height for the input.
*
* @type {number}
*/
maxHeight?: number;
/**
* React component for the voice recording button.
*
* @type {JSX.Element}
*/
VoiceRecordingButtonView?: JSX.Element;
/**
* React component for the secondary button.
*
* @type {JSX.Element}
*/
SecondaryButtonView?: JSX.Element;
/**
* React component for the auxiliary button.
*
* @type {JSX.Element}
*/
AuxiliaryButtonView?: JSX.Element;
/**
* Placement for the auxiliary button.
*
* @type {"left" | "right"}
*/
auxiliaryButtonAlignment?: "left" | "right";
/**
* React component for the primary button.
*
* @type {React.FC}
*/
PrimaryButtonView?: React.FC;
/**
* Callback for when the text selection changes.
*
* @param {NativeSyntheticEvent<TextInputSelectionChangeEventData>} event - The selection change event.
*/
onSelectionChange?: (e: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => void;
/**
* Reference for the TextInput component.
*
* @type {RefObject<any>}
*/
messageInputRef?: RefObject<any>;
}
/**
* CometChatMessageInput renders a message input field with a divider and action buttons.
* It supports auxiliary, secondary, and primary buttons along with search input functionality.
*
* Props for the component.
* The rendered message input component.
*/
export declare const CometChatMessageInput: (props: CometChatMessageInputInterface) => JSX.Element;