/** * 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. * * @flow strict */ import type { NodeKey, RangeSelection, TextNode, SerializedElementNode, LexicalExtension, ExtensionConfigBase, } from 'lexical'; import {ElementNode, LexicalNode} from 'lexical'; export type SerializedMarkNode = SerializedElementNode & { ids: string[], }; declare export class MarkNode extends ElementNode { __ids: string[]; // $FlowFixMe[incompatible-variance] static clone(node: this): MarkNode; constructor(ids: string[], key?: NodeKey): void; hasID(id: string): boolean; getIDs(): string[]; addID(id: string): void; deleteID(id: string): void; canInsertTextBefore(): false; canInsertTextAfter(): false; isInline(): true; } declare export function $isMarkNode( node: ?LexicalNode, ): node is MarkNode; declare export function $createMarkNode(ids: string[]): MarkNode; declare export function $getMarkIDs( node: TextNode, offset: number, ): null | string[]; declare export function $wrapSelectionInMarkNode( selection: RangeSelection, isBackward: boolean, id: string, createNode?: (ids: string[]) => MarkNode, ): void; declare export function $unwrapMarkNode(node: MarkNode): void; declare export var MarkExtension: LexicalExtension;