Class: TextNode
lexical.TextNode
Hierarchy
↳
TextNode
↳↳
HashtagNode
Constructors
constructor
• new TextNode(text
, key?
)
Parameters
Name | Type |
---|---|
text | string |
key? | string |
Overrides
Defined in
lexical/src/nodes/LexicalTextNode.ts:279
Properties
__text
• __text: string
Defined in
lexical/src/nodes/LexicalTextNode.ts:261
Methods
canContainTabs
▸ canContainTabs(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalTextNode.ts:673
canInsertTextAfter
▸ canInsertTextAfter(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalTextNode.ts:669
canInsertTextBefore
▸ canInsertTextBefore(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalTextNode.ts:665
createDOM
▸ createDOM(config
): HTMLElement
Parameters
Name | Type |
---|---|
config | EditorConfig |
Returns
HTMLElement
Overrides
Defined in
lexical/src/nodes/LexicalTextNode.ts:355
exportDOM
▸ exportDOM(editor
): DOMExportOutput
Parameters
Name | Type |
---|---|
editor | LexicalEditor |
Returns
Overrides
Defined in
lexical/src/nodes/LexicalTextNode.ts:498
getDetail
▸ getDetail(): number
Returns
number
Defined in
lexical/src/nodes/LexicalTextNode.ts:294
getFormat
▸ getFormat(): number
Returns
number
Defined in
lexical/src/nodes/LexicalTextNode.ts:289
getFormatFlags
▸ getFormatFlags(type
, alignWithFormat
): number
Parameters
Name | Type |
---|---|
type | TextFormatType |
alignWithFormat | null | number |
Returns
number
Defined in
lexical/src/nodes/LexicalTextNode.ts:347
getMode
▸ getMode(): TextModeType
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:299
getStyle
▸ getStyle(): string
Returns
string
Defined in
lexical/src/nodes/LexicalTextNode.ts:304
getTextContent
▸ getTextContent(): string
Returns
string
Overrides
Defined in
lexical/src/nodes/LexicalTextNode.ts:342
hasFormat
▸ hasFormat(type
): boolean
Parameters
Name | Type |
---|---|
type | TextFormatType |
Returns
boolean
Defined in
lexical/src/nodes/LexicalTextNode.ts:333
isComposing
▸ isComposing(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalTextNode.ts:314
isDirectionless
▸ isDirectionless(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalTextNode.ts:323
isSegmented
▸ isSegmented(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalTextNode.ts:318
isSimpleText
▸ isSimpleText(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalTextNode.ts:338
isTextEntity
▸ isTextEntity(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalTextNode.ts:846
isToken
▸ isToken(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalTextNode.ts:309
isUnmergeable
▸ isUnmergeable(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalTextNode.ts:328
mergeWithSibling
▸ mergeWithSibling(target
): TextNode
Parameters
Name | Type |
---|---|
target | TextNode |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:796
select
▸ select(_anchorOffset?
, _focusOffset?
): RangeSelection
Parameters
Name | Type |
---|---|
_anchorOffset? | number |
_focusOffset? | number |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:590
selectionTransform
▸ selectionTransform(prevSelection
, nextSelection
): void
Parameters
Name | Type |
---|---|
prevSelection | null | RangeSelection | NodeSelection | GridSelection |
nextSelection | RangeSelection |
Returns
void
Defined in
lexical/src/nodes/LexicalTextNode.ts:525
setDetail
▸ setDetail(detail
): TextNode
Parameters
Name | Type |
---|---|
detail | number | TextDetailType |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:541
setFormat
▸ setFormat(format
): TextNode
Parameters
Name | Type |
---|---|
format | number | TextFormatType |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:533
setMode
▸ setMode(type
): TextNode
Parameters
Name | Type |
---|---|
type | TextModeType |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:571
setStyle
▸ setStyle(style
): TextNode
Parameters
Name | Type |
---|---|
style | string |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:548
setTextContent
▸ setTextContent(text
): TextNode
Parameters
Name | Type |
---|---|
text | string |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:581
spliceText
▸ spliceText(offset
, delCount
, newText
, moveSelection?
): TextNode
Parameters
Name | Type |
---|---|
offset | number |
delCount | number |
newText | string |
moveSelection? | boolean |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:631
splitText
▸ splitText(...splitOffsets
): TextNode
[]
Parameters
Name | Type |
---|---|
...splitOffsets | number [] |
Returns
TextNode
[]
Defined in
lexical/src/nodes/LexicalTextNode.ts:677
toggleDirectionless
▸ toggleDirectionless(): TextNode
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:559
toggleFormat
▸ toggleFormat(type
): TextNode
Parameters
Name | Type |
---|---|
type | TextFormatType |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:554
toggleUnmergeable
▸ toggleUnmergeable(): TextNode
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:565
updateDOM
▸ updateDOM(prevNode
, dom
, config
): boolean
Parameters
Name | Type |
---|---|
prevNode | TextNode |
dom | HTMLElement |
config | EditorConfig |
Returns
boolean
Overrides
Defined in
lexical/src/nodes/LexicalTextNode.ts:375
clone
▸ Static
clone(node
): TextNode
Parameters
Name | Type |
---|---|
node | TextNode |
Returns
Overrides
Defined in
lexical/src/nodes/LexicalTextNode.ts:275
getType
▸ Static
getType(): string
Returns
string
Overrides
Defined in
lexical/src/nodes/LexicalTextNode.ts:271
importDOM
▸ Static
importDOM(): null
| DOMConversionMap
<HTMLElement
>
Returns
null
| DOMConversionMap
<HTMLElement
>
Defined in
lexical/src/nodes/LexicalTextNode.ts:442