Class: TextNode
lexical/src.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: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:650
canInsertTextBefore
▸ canInsertTextBefore(): boolean
Returns
boolean
Defined in
lexical/src/nodes/LexicalTextNode.ts:646
createDOM
▸ createDOM(config
): HTMLElement
Parameters
Name | Type |
---|---|
config | EditorConfig |
Returns
HTMLElement
Overrides
Defined in
lexical/src/nodes/LexicalTextNode.ts:358
exportJSON
▸ exportJSON(): SerializedTextNode
Returns
Overrides
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
Name | Type |
---|---|
type | TextFormatType |
alignWithFormat | null | number |
Returns
number
Defined in
lexical/src/nodes/LexicalTextNode.ts:350
getMode
▸ getMode(): TextModeType
Returns
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
Name | Type |
---|---|
includeInert? | boolean |
includeDirectionless? | false |
Returns
string
Overrides
Defined in
lexical/src/nodes/LexicalTextNode.ts:339
hasFormat
▸ hasFormat(type
): boolean
Parameters
Name | Type |
---|---|
type | TextFormatType |
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:828
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
Name | Type |
---|---|
target | TextNode |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:778
select
▸ select(_anchorOffset?
, _focusOffset?
): RangeSelection
Parameters
Name | Type |
---|---|
_anchorOffset? | number |
_focusOffset? | number |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:570
selectionTransform
▸ selectionTransform(prevSelection
, nextSelection
): void
Parameters
Name | Type |
---|---|
prevSelection | null | RangeSelection | NodeSelection | GridSelection |
nextSelection | RangeSelection |
Returns
void
Defined in
lexical/src/nodes/LexicalTextNode.ts:504
setDetail
▸ setDetail(detail
): TextNode
Parameters
Name | Type |
---|---|
detail | number | TextDetailType |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:521
setFormat
▸ setFormat(format
): TextNode
Parameters
Name | Type |
---|---|
format | number | TextFormatType |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:512
setMode
▸ setMode(type
): TextNode
Parameters
Name | Type |
---|---|
type | TextModeType |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:555
setStyle
▸ setStyle(style
): TextNode
Parameters
Name | Type |
---|---|
style | string |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:529
setTextContent
▸ setTextContent(text
): TextNode
Parameters
Name | Type |
---|---|
text | string |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:563
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:611
splitText
▸ splitText(...splitOffsets
): TextNode
[]
Parameters
Name | Type |
---|---|
...splitOffsets | number [] |
Returns
TextNode
[]
Defined in
lexical/src/nodes/LexicalTextNode.ts:654
toggleDirectionless
▸ toggleDirectionless(): TextNode
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:541
toggleFormat
▸ toggleFormat(type
): TextNode
Parameters
Name | Type |
---|---|
type | TextFormatType |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:536
toggleUnmergeable
▸ toggleUnmergeable(): TextNode
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:548
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:378
clone
▸ Static
clone(node
): TextNode
Parameters
Name | Type |
---|---|
node | TextNode |
Returns
Overrides
Defined in
lexical/src/nodes/LexicalTextNode.ts:268
getType
▸ Static
getType(): string
Returns
string
Overrides
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
Name | Type |
---|---|
serializedNode | SerializedTextNode |
Returns
Overrides
Defined in
lexical/src/nodes/LexicalTextNode.ts:482