/** * 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 type { DOMConversionMap, DOMExportOutput, EditorConfig, ElementFormatType, LexicalCommand, LexicalEditor, LexicalNode, NodeKey, ParagraphNode, RangeSelection, SerializedElementNode, Spread } from 'lexical'; import { ElementNode } from 'lexical'; export declare function setNodeIndentFromDOM(domElement: HTMLElement, node: ElementNode): void; export declare function $getHeadingNodeById(id: string): HeadingNode | null; export type SerializedHeadingNode = Spread<{ tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'h7'; id: string; numberString?: string; }, SerializedElementNode>; export declare const DRAG_DROP_PASTE: LexicalCommand>; export type SerializedQuoteNode = SerializedElementNode; /** @noInheritDoc */ export declare class QuoteNode extends ElementNode { static getType(): string; static clone(node: QuoteNode): QuoteNode; createDOM(config: EditorConfig): HTMLElement; updateDOM(prevNode: this, dom: HTMLElement): boolean; static importDOM(): DOMConversionMap | null; exportDOM(editor: LexicalEditor): DOMExportOutput; static importJSON(serializedNode: SerializedQuoteNode): QuoteNode; updateFromJSON(serializedNode: SerializedQuoteNode): QuoteNode; insertNewAfter(_: RangeSelection, restoreSelection?: boolean): ParagraphNode; collapseAtStart(): true; canMergeWhenEmpty(): true; } export declare function $createQuoteNode(): QuoteNode; export declare function $isQuoteNode(node: LexicalNode | null | undefined): node is QuoteNode; export type HeadingTagType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'h7'; /** @noInheritDoc */ export declare class HeadingNode extends ElementNode { /** @internal */ __tag: HeadingTagType; private __id; __numberString: string; __extraAttributes?: string; static getType(): string; static clone(node: HeadingNode): HeadingNode; constructor(tag: HeadingTagType, key?: NodeKey); getTag(): HeadingTagType; setTag(tag: HeadingTagType): this; getLatestIdFromJSON(): string | null; getId(): string; createDOM(config: EditorConfig): HTMLElement; updateDOM(prevNode: this, dom: HTMLElement, config: EditorConfig): boolean; static importDOM(): DOMConversionMap | null; exportDOM(editor: LexicalEditor): DOMExportOutput; setId(id: any): this; static importJSON(serializedNode: SerializedHeadingNode): HeadingNode; updateFromJSON(serializedNode: SerializedHeadingNode): this; exportJSON(): SerializedHeadingNode; insertNewAfter(selection?: RangeSelection, restoreSelection?: boolean): ParagraphNode | HeadingNode; collapseAtStart(): true; extractWithChild(): boolean; toCodoxNode(): { type: string; format: ElementFormatType; version: number; /** * extension: codox_metadata should hold immutables: * - required: your extended node type, e.g. 'warning' * - optional: any immutable properties of an original node - these fields are not merged and synchronized. */ codox_metadata: { type: string; id: string; }; }; /** * Implement the following API methods to interoperate with Codox * Codox -> Lexical Node * Converts synchronized codox json node to lexical json node * must be class 'static' method */ static fromCodoxNode(codoxNode: any): { type: any; text: any; format: any; mode: any; detail: any; version: any; key: any; style: string; /** * set custom attributes */ id: any; color: string; backgroundColor: string; }; } export declare function $createHeadingNode(headingTag?: HeadingTagType): HeadingNode; export declare function $isHeadingNode(node: LexicalNode | null | undefined): node is HeadingNode;