import { Editor, Location, Node, Path } from 'slate'; export interface CellElement extends Node { type: 'table-cell' | 'header-cell'; rowSpan?: number; colSpan?: number; align?: 'left' | 'center' | 'right'; width?: string | number; hidden?: boolean; } export interface Edge { start: number; end: number; } export interface NodeEntryWithContext { node: Node; path: Path; context?: any; } export type SelectionMode = 'cell' | 'row' | 'column' | 'table'; export interface WithType { type: string; } /** * 原生表格编辑器 - 提供基础的表格操作功能 * 替代复杂的 withTable 插件,使用 Slate 原生 API 实现表格操作 */ export declare const NativeTableEditor: { /** * 插入表格 * @param editor - Slate 编辑器实例 * @param options - 表格选项 */ insertTable(editor: Editor, options?: { rows?: number; cols?: number; at?: Location; }): void; /** * 删除表格 * @param editor - Slate 编辑器实例 * @param at - 位置 */ removeTable(editor: Editor, at?: Location): void; /** * 查找表格节点 * @param editor - Slate 编辑器实例 * @param at - 位置 */ findTable(editor: Editor, at?: Location): import("slate").NodeEntry | undefined; /** * 查找表格行节点 * @param editor - Slate 编辑器实例 * @param at - 位置 */ findTableRow(editor: Editor, at?: Location): import("slate").NodeEntry | undefined; /** * 查找表格单元格节点 * @param editor - Slate 编辑器实例 * @param at - 位置 */ findTableCell(editor: Editor, at?: Location): import("slate").NodeEntry | undefined; /** * 检查是否在表格中 * @param editor - Slate 编辑器实例 * @param at - 位置 */ isInTable(editor: Editor, at?: Location): boolean; /** * 检查是否在表格行中 * @param editor - Slate 编辑器实例 * @param at - 位置 */ isInTableRow(editor: Editor, at?: Location): boolean; /** * 检查是否在表格单元格中 * @param editor - Slate 编辑器实例 * @param at - 位置 */ isInTableCell(editor: Editor, at?: Location): boolean; /** * 插入表格行 * @param editor - Slate 编辑器实例 * @param options - 选项 */ insertTableRow(editor: Editor, options?: { at?: Location; position?: 'above' | 'below'; }): void; /** * 删除表格行 * @param editor - Slate 编辑器实例 * @param at - 位置 */ removeTableRow(editor: Editor, at?: Location): void; /** * 插入表格列 * @param editor - Slate 编辑器实例 * @param options - 选项 */ insertTableColumn(editor: Editor, options?: { at?: Location; position?: 'left' | 'right'; }): void; /** * 删除表格列 * @param editor - Slate 编辑器实例 * @param at - 位置 */ removeTableColumn(editor: Editor, at?: Location): void; /** * 移动光标到下一个单元格 * @param editor - Slate 编辑器实例 * @param at - 位置 */ moveToNextCell(editor: Editor, at?: Location): void; /** * 移动光标到上一个单元格 * @param editor - Slate 编辑器实例 * @param at - 位置 */ moveToPreviousCell(editor: Editor, at?: Location): void; };