import { Editor, Node, NodeEntry, Path } from 'slate'; export declare const isValidChild: (child: unknown) => child is any; /** * `Array.prototype.some` skips sparse holes; Slate still sees missing indices and * can pass `undefined` as `leaf` into `renderLeaf`, which then throws in `Text.isText`. */ export declare const childArrayHasInvalidEntries: (rawChildren: unknown[]) => boolean; export declare const getChildList: (node: Node) => unknown[]; export declare const createDefaultBlock: () => any; export declare const rebuildElement: (node: Node) => any; export declare const runWithoutHistory: (editor: Editor, fn: () => void) => void; /** * Slate 的 `Node.nodes` / `Editor.normalize` 在遍历时假定非文本节点必有数组型 `children`。 * 若仅有 `type` 而缺少 `children`,会在进入自定义 `normalizeNode` 之前就抛错,必须先修树。 */ export declare const rebuildOrDefaultBlock: (raw: unknown) => Node; /** 压缩根级子节点:去掉空洞与 null/undefined;残缺元素对象则 rebuild,不凭空多插空段落。 */ export declare const compactEditorRootChildren: (raw: unknown[]) => Node[]; export declare function sanitizeNode(node: Node): Node; /** sanitizeNode 仅在修复时创建新节点,比较子节点引用即可判断是否有变更。 */ export declare const areNodeArraysEqual: (a: Node[], b: Node[]) => boolean; /** 不可变方式整树清洗;合法节点和合法根保留引用,避免复制业务数据。 */ export declare const sanitizeEditorChildren: (raw: unknown) => Node[]; /** * 替换编辑器根节点:结构完好时走 Transforms;稀疏洞/undefined 等损坏根只能直接赋值, * 否则 removeNodes 会因无效 path 抛错(见 withSanitizeInvalidChildren 稀疏根用例)。 */ export declare const setEditorChildrenSafely: (editor: Editor, nodes: Node[]) => void; /** * 在 normalize 守卫阶段修复非法 children。 */ export declare const repairBrokenChildArrays: (editor: Editor) => boolean; export declare const replaceNodeAtPath: (editor: Editor, path: Path, nextNode: Node) => void; export declare const stripInvalidChildrenOnTextLeaf: (editor: Editor, path: Path, node: Node) => boolean; export declare const normalizeEditorRootEntry: (editor: Editor, childList: unknown[], normalizeNode: (entry: NodeEntry) => void) => boolean; export declare const normalizeElementWithInvalidChildren: (editor: Editor, node: any, path: Path) => void; export declare const normalizeElementMissingChildrenArray: (editor: Editor, node: Node, path: Path, normalizeNode: (entry: NodeEntry) => void) => void; export declare const runSanitizeRepairLoop: (editor: Editor) => void;