Class: RangeSelection
lexical.RangeSelection
Implements
Constructors
constructor
• new RangeSelection(anchor
, focus
, format
, style
)
Parameters
Name | Type |
---|---|
anchor | PointType |
focus | PointType |
format | number |
style | string |
Defined in
lexical/src/LexicalSelection.ts:659
Properties
_cachedNodes
• _cachedNodes: null
| LexicalNode
[]
Defined in
lexical/src/LexicalSelection.ts:657
anchor
• anchor: PointType
Defined in
lexical/src/LexicalSelection.ts:652
dirty
• dirty: boolean
Implementation of
Defined in
lexical/src/LexicalSelection.ts:654
focus
• focus: PointType
Defined in
lexical/src/LexicalSelection.ts:653
format
• format: number
Defined in
lexical/src/LexicalSelection.ts:655
style
• style: string
Defined in
lexical/src/LexicalSelection.ts:656
Methods
applyDOMRange
▸ applyDOMRange(range
): void
Parameters
Name | Type |
---|---|
range | StaticRange |
Returns
void
Defined in
lexical/src/LexicalSelection.ts:823
clone
▸ clone(): RangeSelection
Returns
Implementation of
Defined in
lexical/src/LexicalSelection.ts:854
deleteCharacter
▸ deleteCharacter(isBackward
): void
Parameters
Name | Type |
---|---|
isBackward | boolean |
Returns
void
Defined in
lexical/src/LexicalSelection.ts:2042
deleteLine
▸ deleteLine(isBackward
): void
Parameters
Name | Type |
---|---|
isBackward | boolean |
Returns
void
Defined in
lexical/src/LexicalSelection.ts:2154
deleteWord
▸ deleteWord(isBackward
): void
Parameters
Name | Type |
---|---|
isBackward | boolean |
Returns
void
Defined in
lexical/src/LexicalSelection.ts:2171
extract
▸ extract(): LexicalNode
[]
Returns
Implementation of
Defined in
lexical/src/LexicalSelection.ts:1851
formatText
▸ formatText(formatType
): void
Parameters
Name | Type |
---|---|
formatType | TextFormatType |
Returns
void
Defined in
lexical/src/LexicalSelection.ts:1221
getCharacterOffsets
▸ getCharacterOffsets(): [number
, number
]
Returns
[number
, number
]
Defined in
lexical/src/LexicalSelection.ts:1847
getNodes
▸ getNodes(): LexicalNode
[]
Returns
Implementation of
Defined in
lexical/src/LexicalSelection.ts:697
getTextContent
▸ getTextContent(): string
Returns
string
Implementation of
Defined in
lexical/src/LexicalSelection.ts:761
hasFormat
▸ hasFormat(type
): boolean
Parameters
Name | Type |
---|---|
type | TextFormatType |
Returns
boolean
Defined in
lexical/src/LexicalSelection.ts:876
insertLineBreak
▸ insertLineBreak(selectStart?
): void
Parameters
Name | Type |
---|---|
selectStart? | boolean |
Returns
void
Defined in
lexical/src/LexicalSelection.ts:1829
insertNodes
▸ insertNodes(nodes
, selectStart?
): boolean
Parameters
Name | Type |
---|---|
nodes | LexicalNode [] |
selectStart? | boolean |
Returns
boolean
Defined in
lexical/src/LexicalSelection.ts:1345
insertParagraph
▸ insertParagraph(): void
Returns
void
Defined in
lexical/src/LexicalSelection.ts:1719
insertRawText
▸ insertRawText(text
): void
Parameters
Name | Type |
---|---|
text | string |
Returns
void
Implementation of
Defined in
lexical/src/LexicalSelection.ts:881
insertText
▸ insertText(text
): void
Parameters
Name | Type |
---|---|
text | string |
Returns
void
Defined in
lexical/src/LexicalSelection.ts:901
is
▸ is(selection
): boolean
Parameters
Name | Type |
---|---|
selection | null | RangeSelection | NodeSelection | GridSelection |
Returns
boolean
Implementation of
Defined in
lexical/src/LexicalSelection.ts:675
isBackward
▸ isBackward(): boolean
Returns
boolean
Defined in
lexical/src/LexicalSelection.ts:689
isCollapsed
▸ isCollapsed(): boolean
Returns
boolean
Defined in
lexical/src/LexicalSelection.ts:693
modify
▸ modify(alter
, isBackward
, granularity
): void
Parameters
Name | Type |
---|---|
alter | "move" | "extend" |
isBackward | boolean |
granularity | "character" | "word" | "lineboundary" |
Returns
void
Defined in
lexical/src/LexicalSelection.ts:1900
removeText
▸ removeText(): void
Returns
void
Defined in
lexical/src/LexicalSelection.ts:1217
setStyle
▸ setStyle(style
): void
Parameters
Name | Type |
---|---|
style | string |
Returns
void
Defined in
lexical/src/LexicalSelection.ts:871
setTextNodeRange
▸ setTextNodeRange(anchorNode
, anchorOffset
, focusNode
, focusOffset
): void
Parameters
Name | Type |
---|---|
anchorNode | TextNode |
anchorOffset | number |
focusNode | TextNode |
focusOffset | number |
Returns
void
Defined in
lexical/src/LexicalSelection.ts:749
toggleFormat
▸ toggleFormat(format
): void
Parameters
Name | Type |
---|---|
format | TextFormatType |
Returns
void
Defined in
lexical/src/LexicalSelection.ts:866