import { Editor } from 'slate'; /** * 编辑器命令工具函数 * 提供基于 Slate 的富文本编辑器操作接口 */ /** * 切换粗体格式 * @param editor - Slate 编辑器实例 */ export declare const toggleBold: (editor: Editor) => void; /** * 切换斜体格式 * @param editor - Slate 编辑器实例 */ export declare const toggleItalic: (editor: Editor) => void; /** * 切换下划线格式 * @param editor - Slate 编辑器实例 */ export declare const toggleUnderline: (editor: Editor) => void; /** * 切换删除线格式 * @param editor - Slate 编辑器实例 */ export declare const toggleStrikethrough: (editor: Editor) => void; /** * 切换行内代码格式 * @param editor - Slate 编辑器实例 */ export declare const toggleCode: (editor: Editor) => void; /** * 切换标题格式 * @param editor - Slate 编辑器实例 * @param level - 标题级别 (1, 2, 3) */ export declare const toggleHeading: (editor: Editor, level: 1 | 2 | 3) => void; /** * 切换无序列表 * @param editor - Slate 编辑器实例 */ export declare const toggleBulletList: (editor: Editor) => void; /** * 切换有序列表 * @param editor - Slate 编辑器实例 */ export declare const toggleNumberedList: (editor: Editor) => void; /** * 切换引用块格式 * @param editor - Slate 编辑器实例 */ export declare const toggleBlockQuote: (editor: Editor) => void; /** * 插入链接 * @param editor - Slate 编辑器实例 * @param url - 链接地址 * @param text - 链接文本(可选,默认使用当前选中文本) */ export declare const insertLink: (editor: Editor, url: string, text?: string) => void; /** * 插入图片 * @param editor - Slate 编辑器实例 * @param url - 图片地址 * @param alt - 图片替代文本(可选) */ export declare const insertImage: (editor: Editor, url: string, alt?: string) => void; /** * 插入表格 * @param editor - Slate 编辑器实例 * @param rows - 行数 * @param cols - 列数 */ export declare const insertTable: (editor: Editor, rows?: number, cols?: number) => void; /** * 插入代码块 * @param editor - Slate 编辑器实例 * @param language - 编程语言(可选) */ export declare const insertCodeBlock: (editor: Editor, language?: string) => void; /** * 设置文本对齐方式 * @param editor - Slate 编辑器实例 * @param align - 对齐方式 */ export declare const setAlignment: (editor: Editor, align: "left" | "center" | "right") => void; /** * 检查粗体是否激活 * @param editor - Slate 编辑器实例 * @returns 是否激活 */ export declare const isBoldActive: (editor: Editor) => boolean; /** * 检查斜体是否激活 * @param editor - Slate 编辑器实例 * @returns 是否激活 */ export declare const isItalicActive: (editor: Editor) => boolean; /** * 检查下划线是否激活 * @param editor - Slate 编辑器实例 * @returns 是否激活 */ export declare const isUnderlineActive: (editor: Editor) => boolean; /** * 检查删除线是否激活 * @param editor - Slate 编辑器实例 * @returns 是否激活 */ export declare const isStrikethroughActive: (editor: Editor) => boolean; /** * 检查行内代码是否激活 * @param editor - Slate 编辑器实例 * @returns 是否激活 */ export declare const isCodeActive: (editor: Editor) => boolean; /** * 检查标题是否激活 * @param editor - Slate 编辑器实例 * @param level - 标题级别(可选,不传则检查任意级别) * @returns 是否激活 */ export declare const isHeadingActive: (editor: Editor, level?: 1 | 2 | 3) => boolean; /** * 检查无序列表是否激活 * @param editor - Slate 编辑器实例 * @returns 是否激活 */ export declare const isBulletListActive: (editor: Editor) => boolean; /** * 检查有序列表是否激活 * @param editor - Slate 编辑器实例 * @returns 是否激活 */ export declare const isNumberedListActive: (editor: Editor) => boolean; /** * 检查引用块是否激活 * @param editor - Slate 编辑器实例 * @returns 是否激活 */ export declare const isBlockQuoteActive: (editor: Editor) => boolean; /** * 获取当前对齐方式 * @param editor - Slate 编辑器实例 * @returns 对齐方式 */ export declare const getAlignment: (editor: Editor) => "left" | "center" | "right" | null;