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

30 lines
789 B
TypeScript
Raw Normal View History

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