Skip to main content

Class: TextNode

lexical.TextNode

Hierarchy

Constructors

constructor

new TextNode(text, key?)

Parameters

NameType
textstring
key?string

Overrides

LexicalNode.constructor

Defined in

lexical/src/nodes/LexicalTextNode.ts:292

Properties

__text

__text: string

Defined in

lexical/src/nodes/LexicalTextNode.ts:274

Methods

canContainTabs

canContainTabs(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:697


canInsertTextAfter

canInsertTextAfter(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:693


canInsertTextBefore

canInsertTextBefore(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:689


createDOM

createDOM(config): HTMLElement

Parameters

NameType
configEditorConfig

Returns

HTMLElement

Overrides

LexicalNode.createDOM

Defined in

lexical/src/nodes/LexicalTextNode.ts:367


exportDOM

exportDOM(editor): DOMExportOutput

Parameters

NameType
editorLexicalEditor

Returns

DOMExportOutput

Overrides

LexicalNode.exportDOM

Defined in

lexical/src/nodes/LexicalTextNode.ts:510


exportJSON

exportJSON(): SerializedTextNode

Returns

SerializedTextNode

Overrides

LexicalNode.exportJSON

Defined in

lexical/src/nodes/LexicalTextNode.ts:536


getDetail

getDetail(): number

Returns

number

Defined in

lexical/src/nodes/LexicalTextNode.ts:306


getFormat

getFormat(): number

Returns

number

Defined in

lexical/src/nodes/LexicalTextNode.ts:301


getFormatFlags

getFormatFlags(type, alignWithFormat): number

Parameters

NameType
typeTextFormatType
alignWithFormatnull | number

Returns

number

Defined in

lexical/src/nodes/LexicalTextNode.ts:359


getMode

getMode(): TextModeType

Returns

TextModeType

Defined in

lexical/src/nodes/LexicalTextNode.ts:311


getStyle

getStyle(): string

Returns

string

Defined in

lexical/src/nodes/LexicalTextNode.ts:316


getTextContent

getTextContent(): string

Returns

string

Overrides

LexicalNode.getTextContent

Defined in

lexical/src/nodes/LexicalTextNode.ts:354


hasFormat

hasFormat(type): boolean

Parameters

NameType
typeTextFormatType

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:345


isComposing

isComposing(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:326


isDirectionless

isDirectionless(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:335


isSegmented

isSegmented(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:330


isSimpleText

isSimpleText(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:350


isTextEntity

isTextEntity(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:870


isToken

isToken(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:321


isUnmergeable

isUnmergeable(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:340


mergeWithSibling

mergeWithSibling(target): TextNode

Parameters

NameType
targetTextNode

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:820


select

select(_anchorOffset?, _focusOffset?): RangeSelection

Parameters

NameType
_anchorOffset?number
_focusOffset?number

Returns

RangeSelection

Defined in

lexical/src/nodes/LexicalTextNode.ts:614


selectionTransform

selectionTransform(prevSelection, nextSelection): void

Parameters

NameType
prevSelectionnull | RangeSelection | NodeSelection | GridSelection
nextSelectionRangeSelection

Returns

void

Defined in

lexical/src/nodes/LexicalTextNode.ts:549


setDetail

setDetail(detail): TextNode

Parameters

NameType
detailnumber | TextDetailType

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:565


setFormat

setFormat(format): TextNode

Parameters

NameType
formatnumber | TextFormatType

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:557


setMode

setMode(type): TextNode

Parameters

NameType
typeTextModeType

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:595


setStyle

setStyle(style): TextNode

Parameters

NameType
stylestring

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:572


setTextContent

setTextContent(text): TextNode

Parameters

NameType
textstring

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:605


spliceText

spliceText(offset, delCount, newText, moveSelection?): TextNode

Parameters

NameType
offsetnumber
delCountnumber
newTextstring
moveSelection?boolean

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:655


splitText

splitText(...splitOffsets): TextNode[]

Parameters

NameType
...splitOffsetsnumber[]

Returns

TextNode[]

Defined in

lexical/src/nodes/LexicalTextNode.ts:701


toggleDirectionless

toggleDirectionless(): TextNode

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:583


toggleFormat

toggleFormat(type): TextNode

Parameters

NameType
typeTextFormatType

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:578


toggleUnmergeable

toggleUnmergeable(): TextNode

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:589


updateDOM

updateDOM(prevNode, dom, config): boolean

Parameters

NameType
prevNodeTextNode
domHTMLElement
configEditorConfig

Returns

boolean

Overrides

LexicalNode.updateDOM

Defined in

lexical/src/nodes/LexicalTextNode.ts:387


clone

Static clone(node): TextNode

Parameters

NameType
nodeTextNode

Returns

TextNode

Overrides

LexicalNode.clone

Defined in

lexical/src/nodes/LexicalTextNode.ts:288


getType

Static getType(): string

Returns

string

Overrides

LexicalNode.getType

Defined in

lexical/src/nodes/LexicalTextNode.ts:284


importDOM

Static importDOM(): null | DOMConversionMap<HTMLElement>

Returns

null | DOMConversionMap<HTMLElement>

Defined in

lexical/src/nodes/LexicalTextNode.ts:454