@lobehub/editor
Version:
A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.
28 lines (27 loc) • 1.46 kB
TypeScript
import { DOMExportOutput, EditorConfig, ElementDOMSlot, LexicalEditor, LexicalUpdateJSON, SerializedElementNode, Spread } from 'lexical';
import { CardLikeElementNode } from "../../common/node/cursor";
export type DiffType = 'add' | 'remove' | 'modify' | 'unchanged' | 'listItemModify' | 'listItemRemove' | 'listItemAdd';
export type SerializedDiffNode = Spread<{
diffType: DiffType;
}, SerializedElementNode>;
/** DiffNode - contains two block children: original and modified */
export declare class DiffNode extends CardLikeElementNode {
static getType(): string;
static clone(node: DiffNode): DiffNode;
static importJSON(serializedNode: SerializedDiffNode): DiffNode;
static importDOM(): null;
private __diffType;
constructor(type: DiffType, key?: string);
get diffType(): DiffType;
setDiffType(type: DiffType): this;
updateFromJSON(serializedNode: LexicalUpdateJSON<SerializedDiffNode>): this;
exportJSON(): SerializedDiffNode;
exportDOM(editor: LexicalEditor): DOMExportOutput;
createDOM(config: EditorConfig, editor: LexicalEditor): HTMLDivElement;
updateDOM(_prevNode: unknown, _dom: HTMLElement, _config: EditorConfig): boolean;
getDOMSlot(element: HTMLElement): ElementDOMSlot<HTMLElement>;
isInline(): boolean;
isCardLike(): boolean;
}
export declare function $createDiffNode(diffType?: DiffType): DiffNode;
export declare function $isDiffNode(node: unknown): node is DiffNode;