UNPKG

@sendbird/uikit-react-native

Version:

Sendbird UIKit for React Native: A feature-rich and customizable chat UI kit with messaging, channel management, and user authentication.

21 lines (20 loc) 908 B
import { type RefObject } from 'react'; import type { NativeSyntheticEvent, TextInput, TextInputSelectionChangeEventData } from 'react-native'; import { SendbirdFileMessage, SendbirdUserMessage } from '@sendbird/uikit-utils'; import type { MentionedUser } from '../types'; export interface UseMentionTextInputParams { messageToEdit?: SendbirdUserMessage | SendbirdFileMessage; } export interface UseMentionTextInputReturn { textInputRef: RefObject<TextInput | null>; selection: { start: number; end: number; }; onSelectionChange: (e: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => void; text: string; onChangeText: (text: string, addedMentionedUser?: MentionedUser) => void; mentionedUsers: MentionedUser[]; } declare const useMentionTextInput: (params: UseMentionTextInputParams) => UseMentionTextInputReturn; export default useMentionTextInput;