import { default as React } from 'react'; export interface ToolbarConfig { /** 历史操作:撤销、重做 */ history?: boolean | ('undo' | 'redo')[]; /** 文本格式化:粗体、斜体、下划线、删除线、代码 */ textFormat?: boolean | ('bold' | 'italic' | 'underline' | 'strikethrough' | 'code')[]; /** 颜色选项:文本颜色、背景颜色、高亮 */ color?: boolean | ('textColor' | 'backgroundColor' | 'highlight')[]; /** 文本对齐:左对齐、居中、右对齐、两端对齐 */ align?: boolean | ('left' | 'center' | 'right' | 'justify')[]; /** 列表类型:无序列表、有序列表、待办列表 */ list?: boolean | ('bulleted' | 'numbered' | 'todo')[]; /** 可插入元素:链接、图片、视频、音频、文件、表格、表情、公式 */ insert?: boolean | ('link' | 'image' | 'video' | 'audio' | 'file' | 'table' | 'emoji' | 'equation')[]; /** 高级功能:AI、评论、导出、导入 */ advanced?: boolean | ('ai' | 'comment' | 'export' | 'import')[]; /** 排版:字体大小、行高 */ typography?: boolean | ('fontSize' | 'lineHeight')[]; /** 额外格式化:上标、下标、键盘 */ extraFormat?: boolean | ('superscript' | 'subscript' | 'keyboard')[]; /** 块操作:缩进、取消缩进、切换 */ blockOps?: boolean | ('indent' | 'outdent' | 'toggle')[]; /** 转换为:转换块类型(段落、标题、列表等) */ turnInto?: boolean | ('paragraph' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'bulleted' | 'numbered' | 'todo' | 'codeBlock' | 'blockquote' | 'columns')[]; /** 是否显示模式切换下拉菜单(编辑/建议/查看),默认 true */ showModeSelector?: boolean; /** 工具栏默认对齐方式 */ toolbarAlign?: ToolbarAlign; /** 工具栏是否占据全宽 */ toolbarFullWidth?: boolean; /** 工具栏自定义类名 */ toolbarClassName?: string; /** 工具栏内联样式 */ toolbarStyle?: React.CSSProperties; } export type ToolbarFeatureId = 'undo' | 'redo' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'textColor' | 'backgroundColor' | 'highlight' | 'left' | 'center' | 'right' | 'justify' | 'bulleted' | 'numbered' | 'todo' | 'link' | 'image' | 'video' | 'audio' | 'file' | 'table' | 'emoji' | 'equation' | 'ai' | 'comment' | 'export' | 'import' | 'fontSize' | 'lineHeight' | 'superscript' | 'subscript' | 'keyboard' | 'indent' | 'outdent' | 'toggle' | 'turnInto' | 'paragraph' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'codeBlock' | 'blockquote' | 'columns'; export type ToolbarGroupId = keyof ToolbarConfig; export type ToolbarAlign = 'left' | 'center' | 'right' | 'justify';