UNPKG

@lobehub/editor

Version:

A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.

26 lines (25 loc) 1.17 kB
import { EditorConfig, ElementNode, LexicalEditor, LexicalNode, SerializedElementNode } from 'lexical'; export type SerializedLinkHighlightNode = SerializedElementNode; export declare class LinkHighlightNode extends ElementNode { static getType(): string; static clone(node: LinkHighlightNode): LinkHighlightNode; static importJSON(serializedNode: SerializedLinkHighlightNode): LinkHighlightNode; createDOM(config: EditorConfig): HTMLElement; /** * Format URL to ensure it has proper protocol */ private formatUrl; canBeEmpty(): false; isInline(): true; canInsertTextBefore(): false; canInsertTextAfter(): false; updateDOM(prevNode: LinkHighlightNode, dom: HTMLElement, config: EditorConfig): boolean; /** * Get the URL from the text content */ getURL(): string; } export declare function $createLinkHighlightNode(): LinkHighlightNode; export declare function $isLinkHighlightNode(node: unknown): node is LinkHighlightNode; export declare function getLinkHighlightNode(node: LexicalNode): LinkHighlightNode | null; export declare function $isSelectionInLinkHighlight(editor: LexicalEditor): boolean;