@douyinfe/semi-ui
Version:
A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.
64 lines (63 loc) • 3.17 kB
TypeScript
import React from 'react';
import BaseComponent from '../_base/baseComponent';
import { AIChatInputProps, AIChatInputState, Attachment, Reference, Content } from './interface';
import { Upload } from '../index';
import { IconSize } from '@douyinfe/semi-icons';
import '@douyinfe/semi-foundation/lib/es/aiChatInput/aiChatInput.css';
import { getCustomSlotAttribute } from '@douyinfe/semi-foundation/lib/es/aiChatInput/utils';
import Configure from './configure';
import { Editor, FocusPosition } from '@tiptap/core';
import AIChatInputFoundation, { AIChatInputAdapter } from '@douyinfe/semi-foundation/lib/es/aiChatInput/foundation';
import { ContextValue } from '../configProvider/context';
import getConfigureItem from './configure/getConfigureItem';
import { Content as TiptapContent } from "@tiptap/core";
export { getConfigureItem };
export * from './interface';
declare class AIChatInput extends BaseComponent<AIChatInputProps, AIChatInputState> {
static __SemiComponentName__: string;
static Configure: typeof Configure;
static contextType: React.Context<ContextValue>;
static getCustomSlotAttribute: typeof getCustomSlotAttribute;
private clickOutsideHandler;
static defaultProps: Partial<AIChatInputProps>;
constructor(props: AIChatInputProps);
editor: Editor;
triggerRef: React.RefObject<HTMLDivElement>;
configureRef: React.RefObject<Configure>;
popUpOptionListID: string;
foundation: AIChatInputFoundation;
transformedContent: Content[];
context: ContextValue;
uploadRef: React.RefObject<Upload>;
richTextDIVRef: React.RefObject<HTMLDivElement>;
suggestionPanelRef: React.RefObject<HTMLDivElement>;
get adapter(): AIChatInputAdapter<AIChatInputProps, AIChatInputState>;
componentDidUpdate(prevProps: Readonly<AIChatInputProps>): void;
componentWillUnmount(): void;
setContent: (content: TiptapContent) => void;
focusEditor: (pos: FocusPosition) => void;
changeTemplateVisible: (value: boolean) => void;
getEditor: () => Editor;
deleteContent(content: Content): void;
setEditor: (editor: Editor) => void;
setContentWhileSaveTool: (content: string) => void;
renderTemplate(): React.JSX.Element;
renderSkill(): React.JSX.Element;
renderSuggestions(): React.JSX.Element;
renderPopoverContent(): React.JSX.Element;
handleReferenceDelete: (reference: Reference) => void;
getIconByType(type: string, size?: IconSize): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
getReferenceIconByType(type: string): React.JSX.Element;
getAttachmentIconByType(type: string): React.JSX.Element;
renderReference(): React.JSX.Element;
deleteUploadFile: (item: Attachment) => void;
renderAttachment(): React.JSX.Element;
renderTopArea(): React.JSX.Element;
renderLeftFooter: () => React.JSX.Element;
renderUploadNode: () => React.JSX.Element;
renderSendButton: () => React.JSX.Element;
renderRightFooter: () => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element;
renderFooter: () => React.JSX.Element;
render(): React.JSX.Element;
}
export default AIChatInput;