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:272

Properties

__detail

__detail: number

Defined in

lexical/src/nodes/LexicalTextNode.ts:262


__format

__format: number

Defined in

lexical/src/nodes/LexicalTextNode.ts:259


__mode

__mode: 0 | 1 | 2 | 3

Defined in

lexical/src/nodes/LexicalTextNode.ts:261


__style

__style: string

Defined in

lexical/src/nodes/LexicalTextNode.ts:260


__text

__text: string

Defined in

lexical/src/nodes/LexicalTextNode.ts:258

Methods

canInsertTextAfter

canInsertTextAfter(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:642


canInsertTextBefore

canInsertTextBefore(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:638


createDOM

createDOM(config): HTMLElement

Parameters

NameType
configEditorConfig

Returns

HTMLElement

Overrides

LexicalNode.createDOM

Defined in

lexical/src/nodes/LexicalTextNode.ts:358


exportJSON

exportJSON(): SerializedTextNode

Returns

SerializedTextNode

Overrides

LexicalNode.exportJSON

Defined in

lexical/src/nodes/LexicalTextNode.ts:491


getDetail

getDetail(): number

Returns

number

Defined in

lexical/src/nodes/LexicalTextNode.ts:286


getFormat

getFormat(): number

Returns

number

Defined in

lexical/src/nodes/LexicalTextNode.ts:281


getFormatFlags

getFormatFlags(type, alignWithFormat): number

Parameters

NameType
typeTextFormatType
alignWithFormatnull | number

Returns

number

Defined in

lexical/src/nodes/LexicalTextNode.ts:350


getMode

getMode(): TextModeType

Returns

TextModeType

Defined in

lexical/src/nodes/LexicalTextNode.ts:291


getStyle

getStyle(): string

Returns

string

Defined in

lexical/src/nodes/LexicalTextNode.ts:296


getTextContent

getTextContent(includeInert?, includeDirectionless?): string

Parameters

NameType
includeInert?boolean
includeDirectionless?false

Returns

string

Overrides

LexicalNode.getTextContent

Defined in

lexical/src/nodes/LexicalTextNode.ts:339


hasFormat

hasFormat(type): boolean

Parameters

NameType
typeTextFormatType

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:330


isComposing

isComposing(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:306


isDirectionless

isDirectionless(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:320


isInert

isInert(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:315


isSegmented

isSegmented(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:310


isSimpleText

isSimpleText(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:335


isTextEntity

isTextEntity(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:820


isToken

isToken(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:301


isUnmergeable

isUnmergeable(): boolean

Returns

boolean

Defined in

lexical/src/nodes/LexicalTextNode.ts:325


mergeWithSibling

mergeWithSibling(target): TextNode

Parameters

NameType
targetTextNode

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:770


select

select(_anchorOffset?, _focusOffset?): RangeSelection

Parameters

NameType
_anchorOffset?number
_focusOffset?number

Returns

RangeSelection

Defined in

lexical/src/nodes/LexicalTextNode.ts:563


selectionTransform

selectionTransform(prevSelection, nextSelection): void

Parameters

NameType
prevSelectionnull | RangeSelection | NodeSelection | GridSelection
nextSelectionRangeSelection

Returns

void

Defined in

lexical/src/nodes/LexicalTextNode.ts:504


setDetail

setDetail(detail): TextNode

Parameters

NameType
detailnumber | TextDetailType

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:520


setFormat

setFormat(format): TextNode

Parameters

NameType
formatnumber | TextFormatType

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:512


setMode

setMode(type): TextNode

Parameters

NameType
typeTextModeType

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:550


setStyle

setStyle(style): TextNode

Parameters

NameType
stylestring

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:527


setTextContent

setTextContent(text): TextNode

Parameters

NameType
textstring

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:557


spliceText

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

Parameters

NameType
offsetnumber
delCountnumber
newTextstring
moveSelection?boolean

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:604


splitText

splitText(...splitOffsets): TextNode[]

Parameters

NameType
...splitOffsetsnumber[]

Returns

TextNode[]

Defined in

lexical/src/nodes/LexicalTextNode.ts:646


toggleDirectionless

toggleDirectionless(): TextNode

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:538


toggleFormat

toggleFormat(type): TextNode

Parameters

NameType
typeTextFormatType

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:533


toggleUnmergeable

toggleUnmergeable(): TextNode

Returns

TextNode

Defined in

lexical/src/nodes/LexicalTextNode.ts:544


updateDOM

updateDOM(prevNode, dom, config): boolean

Parameters

NameType
prevNodeTextNode
domHTMLElement
configEditorConfig

Returns

boolean

Overrides

LexicalNode.updateDOM

Defined in

lexical/src/nodes/LexicalTextNode.ts:378


clone

Static clone(node): TextNode

Parameters

NameType
nodeTextNode

Returns

TextNode

Overrides

LexicalNode.clone

Defined in

lexical/src/nodes/LexicalTextNode.ts:268


getType

Static getType(): string

Returns

string

Overrides

LexicalNode.getType

Defined in

lexical/src/nodes/LexicalTextNode.ts:264


importDOM

Static importDOM(): null | DOMConversionMap<HTMLElement>

Returns

null | DOMConversionMap<HTMLElement>

Defined in

lexical/src/nodes/LexicalTextNode.ts:445


importJSON

Static importJSON(serializedNode): TextNode

Parameters

NameType
serializedNodeSerializedTextNode

Returns

TextNode

Overrides

LexicalNode.importJSON

Defined in

lexical/src/nodes/LexicalTextNode.ts:482