UNPKG

@uimkit/uikit-react

Version:

<img style="width:64px" src="https://mgmt.uimkit.chat/media/img/avatar.png"/>

45 lines (42 loc) 1.72 kB
import { Dispatch, MutableRefObject } from 'react'; import { CONSTANT_DISPATCH_TYPE } from '../../../constants.js'; import { UIMessageInputProps } from '../UIMessageInput.js'; import { Profile } from '../../../types/models.js'; import { MessageInputContextValue } from '../../../context/MessageInputContext.js'; interface IbaseStateProps { state: MessageInputState; dispatch: Dispatch<MessageInputReducerAction>; } interface MessageInputState { text?: string; mentioned_users?: Profile[]; setText?: (text: string) => void; } interface ICursorPos { start?: number; end?: number; } type SetTextAction = { getNewText: (currentStateText: string) => string; type: CONSTANT_DISPATCH_TYPE.SET_TEXT; }; type MessageInputHookProps = { insertText: (textToInsert: string) => void; handleChange?: React.ChangeEventHandler<HTMLTextAreaElement>; handleSubmit: (event: React.BaseSyntheticEvent) => void; onPaste: (event: React.ClipboardEvent | any) => void; onSelectEmoji: (emoji: any) => void; onSelectUser: (item: Profile) => void; textareaRef?: MutableRefObject<HTMLTextAreaElement | null | undefined>; }; type AddMentionedUserAction = { type: CONSTANT_DISPATCH_TYPE.ADD_MENTIONED_USER; user: Profile; }; type ClearAction = { type: 'clear'; }; type MessageInputReducerAction = SetTextAction | ClearAction | AddMentionedUserAction; declare const useMessageInputState: (props: UIMessageInputProps) => MessageInputState & MessageInputHookProps & MessageInputContextValue; export { ICursorPos, IbaseStateProps, MessageInputHookProps, MessageInputReducerAction, MessageInputState, useMessageInputState }; //# sourceMappingURL=useMessageInputState.d.ts.map