UNPKG

@lexical/mark

Version:

This package contains helpers and nodes for wrapping content in marks for Lexical.

41 lines (40 loc) 1.83 kB
/** * 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 BaseSelection, type EditorConfig, ElementNode, type LexicalNode, type LexicalUpdateJSON, type NodeKey, type RangeSelection, type SerializedElementNode, type Spread } from 'lexical'; export type SerializedMarkNode = Spread<{ ids: string[]; }, SerializedElementNode>; /** @noInheritDoc */ export declare class MarkNode extends ElementNode { /** @internal */ __ids: readonly string[]; static getType(): string; static clone(node: MarkNode): MarkNode; afterCloneFrom(prevNode: this): void; static importDOM(): null; static importJSON(serializedNode: SerializedMarkNode): MarkNode; updateFromJSON(serializedNode: LexicalUpdateJSON<SerializedMarkNode>): this; exportJSON(): SerializedMarkNode; constructor(ids?: readonly string[], key?: NodeKey); createDOM(config: EditorConfig): HTMLElement; updateDOM(prevNode: this, element: HTMLElement, config: EditorConfig): boolean; hasID(id: string): boolean; getIDs(): string[]; setIDs(ids: readonly string[]): this; addID(id: string): this; deleteID(id: string): this; insertNewAfter(selection: RangeSelection, restoreSelection?: boolean): null | ElementNode; canInsertTextBefore(): boolean; canInsertTextAfter(): boolean; canBeEmpty(): false; isInline(): true; extractWithChild(child: LexicalNode, selection: BaseSelection, destination: 'clone' | 'html'): boolean; excludeFromCopy(destination: 'clone' | 'html'): boolean; } export declare function $createMarkNode(ids?: readonly string[]): MarkNode; export declare function $isMarkNode(node: LexicalNode | null): node is MarkNode;