@lobehub/editor
Version:
A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.
46 lines (45 loc) • 2.19 kB
TypeScript
import { DOMConversionMap, DOMConversionOutput, DOMExportOutput, DecoratorNode, EditorConfig, LexicalEditor, LexicalNode, LexicalUpdateJSON, SerializedLexicalNode, Spread } from 'lexical';
export type SerializedMathInlineNode = Spread<{
code: string;
}, SerializedLexicalNode>;
export declare class MathInlineNode extends DecoratorNode<unknown> {
static getType(): string;
static clone(node: MathInlineNode): MathInlineNode;
static importJSON(serializedNode: SerializedMathInlineNode): MathInlineNode;
static importDOM(): DOMConversionMap | null;
__code: string;
constructor(code?: string, key?: string);
get code(): string;
updateCode(newCode: string): void;
exportDOM(): DOMExportOutput;
createDOM(config: EditorConfig): HTMLElement;
exportJSON(): SerializedMathInlineNode;
updateFromJSON(serializedNode: LexicalUpdateJSON<SerializedMathInlineNode>): this;
getTextContent(): string;
isInline(): boolean;
updateDOM(): boolean;
decorate(editor: LexicalEditor): unknown;
}
export declare class MathBlockNode extends DecoratorNode<unknown> {
static getType(): string;
static clone(node: MathBlockNode): MathBlockNode;
static importJSON(serializedNode: SerializedMathInlineNode): MathBlockNode;
static importDOM(): DOMConversionMap | null;
__code: string;
constructor(code?: string, key?: string);
get code(): string;
updateCode(newCode: string): void;
exportDOM(): DOMExportOutput;
createDOM(config: EditorConfig): HTMLElement;
exportJSON(): SerializedMathInlineNode;
updateFromJSON(serializedNode: LexicalUpdateJSON<SerializedMathInlineNode>): this;
getTextContent(): string;
isInline(): boolean;
updateDOM(): boolean;
decorate(editor: LexicalEditor): unknown;
}
export declare function $createMathInlineNode(code?: string): MathInlineNode;
export declare function $createMathBlockNode(code?: string): MathBlockNode;
export declare function $convertMathInlineElement(): DOMConversionOutput;
export declare function $convertMathBlockElement(): DOMConversionOutput;
export declare function $isMathNode(node: LexicalNode): node is MathInlineNode | MathBlockNode;