@uimkit/uikit-react
Version:
<img style="width:64px" src="https://mgmt.uimkit.chat/media/img/avatar.png"/>
53 lines (50 loc) • 2.49 kB
TypeScript
import React__default, { MutableRefObject, PropsWithChildren } from 'react';
import { Message, UserSearchQuery } from '../../types/models.js';
import { UnknowPorps } from '../../context/ComponentContext.js';
interface PluginConfigProps {
plugins?: Array<React__default.ReactElement>;
showNumber?: number;
MoreIcon?: React__default.ReactElement;
isEmojiPicker?: boolean;
isImagePicker?: boolean;
isVideoPicker?: boolean;
isFilePicker?: boolean;
}
interface UIMessageInputBasicProps {
/** 额外的传入 `AutoCompleteTextarea` 组件的属性, [可用属性](https://www.npmjs.com/package/react-textarea-autosize) */
additionalTextareaProps?: React__default.TextareaHTMLAttributes<HTMLTextAreaElement>;
/** 清除编辑状态 */
clearEditingState?: () => void;
/** 如果为 true, 禁用 输入 */
disabled?: boolean;
focus?: boolean;
textareaRef?: MutableRefObject<HTMLTextAreaElement | undefined>;
isTransmitter?: boolean;
className?: string;
pluginConfig?: PluginConfigProps;
/** 如果提供, 则会基于此消息进行编辑并提交 */
message?: Message;
overrideSubmitHandler?: (message: Message, conversationId: string) => Promise<void> | void;
/** 如果为 true, @ 的提示列表将不会被展示. 默认: false. */
disableMentions?: boolean;
mentionQueryParams?: UserSearchQuery;
/** If true, will use an optional dependency to support transliteration in the input for mentions, default is false. See: https://github.com/getstream/transliterate */
/**
* Currently, `Enter` is the default submission key and `Shift`+`Enter` is the default combination for the new line.
* If specified, this function overrides the default behavior specified previously.
*
* Example of default behaviour:
* ```tsx
* const defaultShouldSubmit = (event) => event.key === "Enter" && !event.shiftKey;
* ```
*/
shouldSubmit?: (event: KeyboardEvent) => boolean;
}
interface UIMessageInputProps extends UIMessageInputBasicProps {
UIMessageInput?: React__default.ComponentType;
InputPlugins?: React__default.ComponentType<UnknowPorps>;
InputQuote?: React__default.ComponentType<UnknowPorps>;
}
declare function UIMessageInput<T extends UIMessageInputProps>(props: PropsWithChildren<T>): JSX.Element;
export { PluginConfigProps, UIMessageInput, UIMessageInputBasicProps, UIMessageInputProps };
//# sourceMappingURL=UIMessageInput.d.ts.map