zy-react-library/components/Editor/index.d.ts

30 lines
761 B
TypeScript
Raw Normal View History

2025-12-06 15:48:29 +08:00
import type { IDomEditor } from "@wangeditor/editor";
2025-12-06 15:08:03 +08:00
import type { ForwardRefExoticComponent, RefAttributes } from "react";
export interface EditorProps {
/** 编辑器内容值 */
2025-12-06 15:45:33 +08:00
value: string;
2025-12-06 15:08:03 +08:00
/** 内容改变回调 */
2025-12-06 15:45:33 +08:00
onChange: (html: string) => void;
2025-12-06 15:08:03 +08:00
/** 是否禁用 */
disabled?: boolean;
}
export interface EditorRef {
/** 获取编辑器实例 */
2025-12-06 15:48:29 +08:00
getEditorInstance: () => IDomEditor | null;
2025-12-06 15:08:03 +08:00
/** 获取HTML内容 */
getHtml: () => string | undefined;
/** 设置HTML内容 */
setHtml: (value: string) => void;
/** 获取文本内容 */
getText: () => string | undefined;
}
/**
*
*/
declare const Editor: ForwardRefExoticComponent<EditorProps & RefAttributes<EditorRef>>;
export default Editor;