/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import React from "react"; import type { DOMConversionMap, DOMExportOutput, EditorConfig, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from "lexical"; import { DecoratorNode } from "lexical"; export type SerializedImageNode = Spread<{ id: string; altText: string; height?: number; maxWidth: number; src: string; width?: number; }, SerializedLexicalNode>; export interface ImageNodeProps { id: string; src: string; altText: string; maxWidth: number; width?: "inherit" | number; height?: "inherit" | number; } export declare class ImageNode extends DecoratorNode { __id: string; __src: string; __altText: string; __width: "inherit" | number; __height: "inherit" | number; __maxWidth: number; static getType(): string; static clone(node: ImageNode): ImageNode; static importJSON(serializedNode: SerializedImageNode): ImageNode; exportDOM(): DOMExportOutput; /** * Control how an HTMLElement is represented in Lexical. * DOM data comes from clipboard or parsing HTML to nodes with the available lexical functions. * (@see @lexical/html package: https://github.com/facebook/lexical/blob/main/packages/lexical-html/README.md). */ static importDOM(): DOMConversionMap | null; constructor(props: ImageNodeProps, key?: NodeKey); exportJSON(): SerializedImageNode; setWidthAndHeight(width: "inherit" | number, height: "inherit" | number): void; createDOM(config: EditorConfig): HTMLElement; updateDOM(): false; getSrc(): string; getAltText(): string; decorate(): React.JSX.Element; } export declare function $createImageNode(props: ImageNodeProps, key?: string): ImageNode; export declare function $isImageNode(node: LexicalNode | null | undefined): node is ImageNode;