import { Fragment, Node as PMNode } from '@tiptap/pm/model'; import { Editor } from '@tiptap/react'; export type LinewiseTarget = { type: 'paragraph'; } | { type: 'heading'; level: 1 | 2 | 3 | 4 | 5 | 6; } | { type: 'orderedList'; } | { type: 'bulletList'; } | { type: 'taskList'; } | { type: 'blockquote'; } | { type: 'alert'; attrs?: { variant?: string; type?: 'icon' | 'text'; }; }; /** * 提取节点的“行”文本: * - paragraph/heading:单行 * - blockquote:子块逐段(按段) * - codeBlock:按换行 * - alert:按换行 * - list(ordered/bullet/task):每个 listItem 作为一行(包含其文本内容) * - 其他:作为单行处理 */ export declare function extractLinesFromNode(node: PMNode): string[]; /** * 根据目标类型,构造对应的节点或片段。 */ export declare function buildNodeFromLines(editor: Editor, lines: string[], target: LinewiseTarget): PMNode | Fragment; /** * 将给定位置的节点转换为目标类型(按行规则)。 */ export declare function convertNodeAt(editor: Editor, pos: number, node: PMNode, target: LinewiseTarget): void;