Skip to main content

LMInputContext

Introduction

The LMInputContext provides the data and functions related to Input components. It wraps all the components inside LMInput. You can use this context to manage or access data and functions related to input actions.

PropertyTypeDescriptionOptional
inputBoxRefMutableRefObject<HTMLDivElement \| null>Reference to the input box element.
inputWrapperRefMutableRefObject<HTMLDivElement \| null>Reference to the input wrapper element.
inputTextstringThe current input text value.
matchedTagMembersListMember[]List of matched tag members.
fetchMoreTagsbooleanIndicates if more tags need to be fetched.
imagesAndVideosMediaListFile[] \| nullList of selected image and video files.✔️
documentsMediaListFile[] \| nullList of selected document files.✔️
ogTagOgTag | nullOpen Graph tag data.✔️
gifMediaGif \| nullSelected GIF media.✔️
gifsGif[]List of fetched GIFs.
loadingGifsbooleanIndicates if GIFs are being loaded.
errorOnGifsstring \| nullError message for GIF fetching.✔️
gifQuerystringSearch query for GIFs.
openGifCollapsebooleanWhether the GIF section is open.
updateInputTextonChangeUpdateInputTextFunction to update the input text.
onTextInputKeydownHandleronKeydownEventKeydown event handler for the input.
onTextInputKeyUpHandleronKeyUpEventKeyup event handler for the input.
clearTaggingListZeroArgVoidReturnsFunction to clear the tagging list.
addEmojiToTextTwoArgVoidReturns<EmojiData, MouseEvent:gt;Function to add an emoji to the input text.
addImagesAndVideosMediaOneArgVoidReturns<ChangeEvent<HTMLInputElement>>Function to add images and videos.
addDocumentsMediaOneArgVoidReturns<ChangeEven<<HTMLInputElement>>Function to add document files.
postMessageOneOptionalArgVoidReturns<Record<string, any>>Function to post a message.
getTaggingMembersOneOptionalArgVoidReturns<number>Function to fetch tagging members.
removeOgTagZeroArgVoidReturnsFunction to remove Open Graph tag data.
setGifMediaDispatch<Gif \| null>Function to set the selected GIF media.
setOpenGifCollapseDispatch<boolean>Function to toggle the GIF section.
gifSearchQueryOneArgVoidReturns<string>Function to update the GIF search query.
fetchGifsOneArgVoidReturns<string>Function to fetch GIFs based on a query.
handleGifSearchZeroArgVoidReturnsFunction to handle GIF search actions.
removeMediaFromImageListOneArgVoidReturns<number>Function to remove an image from the media list.
removeMediaFromDocumentListOneArgVoidReturns<number>Function to remove a document from the media list.
sendDMRequestOneArgVoidReturns<string>Function to send a direct message request.
rejectDMRequestZeroArgVoidReturnsFunction to reject a direct message request.
aprooveDMRequestZeroArgVoidReturnsFunction to approve a direct message request.
alertMessagestring \| nullAlert message content.✔️
shouldShowInputBoxZeroArgBooleanReturnsFunction to determine if the input box should be shown.

Reference

For reference checkout this file