/** * 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 { KlassConstructor, LexicalEditor } from '../LexicalEditor.js'; import type { ElementNode } from './LexicalElementNode.js'; import type { EditorConfig } from 'lexical'; import { LexicalNode, type NodeKey, type SlotChildNode, type SlotHostNode } from '../LexicalNode.js'; export interface DecoratorNode { getTopLevelElement(): ElementNode | this | null; getTopLevelElementOrThrow(): ElementNode | this; } /** @noInheritDoc */ export declare class DecoratorNode extends LexicalNode implements SlotHostNode, SlotChildNode { /** @internal */ ['constructor']: KlassConstructor>; /** @internal */ __slotHost: null | NodeKey; /** @internal */ __slots: null | Map; constructor(key?: NodeKey); afterCloneFrom(prevNode: this): void; /** * The returned value is added to the LexicalEditor._decorators */ decorate(editor: LexicalEditor, config: EditorConfig): null | T; /** * Whether this decorator is isolated from caret interaction: an isolated * decorator can not be traversed, extended over, selected as a node, or * deleted by an adjacent caret operation. A caret that reaches one stops * there, so an inline isolated decorator is only reachable by pointer. * * Defaults to false, which lets the caret step over the decorator (and * select it, when {@link DecoratorNode.isKeyboardSelectable} is also true). */ isIsolated(): boolean; isInline(): boolean; isKeyboardSelectable(): boolean; } /** Returns true if the given node is a DecoratorNode. */ export declare function $isDecoratorNode(node: LexicalNode | null | undefined): node is DecoratorNode;