@lobehub/editor
Version:
A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.
45 lines (44 loc) • 1.7 kB
TypeScript
import { DOMExportOutput, DecoratorNode, EditorConfig, LexicalEditor, LexicalUpdateJSON, NodeKey, SerializedEditor, SerializedLexicalNode, Spread } from 'lexical';
export interface ImagePayload {
altText: string;
caption?: LexicalEditor;
captionsEnabled?: boolean;
height?: number;
key?: NodeKey;
maxWidth?: number;
showCaption?: boolean;
src: string;
width?: number;
}
export type SerializedImageNode = Spread<{
altText: string;
caption: SerializedEditor;
height?: number;
maxWidth: number;
showCaption: boolean;
src: string;
width?: number;
}, SerializedLexicalNode>;
export declare class BaseImageNode extends DecoratorNode<any> {
__src: string;
__altText: string;
__width: 'inherit' | number;
__height: 'inherit' | number;
__maxWidth: number;
__showCaption: boolean;
__caption: LexicalEditor;
__captionsEnabled: boolean;
static clone(node: BaseImageNode): BaseImageNode;
static importJSON(serializedNode: SerializedImageNode): BaseImageNode;
static getType(): string;
updateFromJSON(serializedNode: LexicalUpdateJSON<SerializedImageNode>): this;
exportDOM(): DOMExportOutput;
constructor(src: string, altText: string, maxWidth: number, width?: 'inherit' | number, height?: 'inherit' | number, showCaption?: boolean, caption?: LexicalEditor, captionsEnabled?: boolean, key?: NodeKey);
exportJSON(): SerializedImageNode;
setWidthAndHeight(width: 'inherit' | number, height: 'inherit' | number): void;
setShowCaption(showCaption: boolean): void;
createDOM(config: EditorConfig): HTMLElement;
updateDOM(): false;
getSrc(): string;
getAltText(): string;
}