@lobehub/editor
Version:
A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.
22 lines (21 loc) • 1.12 kB
TypeScript
import { EditorConfig, LexicalEditor, LexicalNode, SerializedElementNode } from 'lexical';
import { CardLikeElementNode } from "../../common/node/cursor";
export type SerializedCodeNode = SerializedElementNode;
export declare class CodeNode extends CardLikeElementNode {
static getType(): string;
static clone(node: CodeNode): CodeNode;
static importJSON(serializedNode: SerializedCodeNode): CodeNode;
createDOM(config: EditorConfig): HTMLElement;
getDOMSlot(element: HTMLElement): import("lexical").ElementDOMSlot<HTMLElement>;
canBeEmpty(): boolean;
isCardLike(): boolean;
isInline(): boolean;
canIndent(): boolean;
canInsertTextBefore(): boolean;
canInsertTextAfter(): boolean;
updateDOM(prevNode: CodeNode, dom: HTMLElement, config: EditorConfig): boolean;
}
export declare function $createCodeNode(textContent?: string): CodeNode;
export declare function $isCodeInlineNode(node: unknown): node is CodeNode;
export declare function getCodeInlineNode(node: LexicalNode): LexicalNode | null;
export declare function $isSelectionInCodeInline(editor: LexicalEditor): boolean;