Interface: NodeCaretRange<D>
lexical.NodeCaretRange
A RangeSelection expressed as a pair of Carets
Type parameters
Name | Type |
---|---|
D | extends CaretDirection = CaretDirection |
Hierarchy
-
Iterable
<RangeNodeCaret
<D
>>↳
NodeCaretRange
Properties
anchor
• anchor: RangeNodeCaret
<D
>
Defined in
packages/lexical/src/LexicalCaret.ts:93
direction
• Readonly
direction: D
Defined in
packages/lexical/src/LexicalCaret.ts:92
focus
• focus: RangeNodeCaret
<D
>
Defined in
packages/lexical/src/LexicalCaret.ts:94
internalCarets
• internalCarets: (rootMode
: RootMode
) => IterableIterator
<NodeCaret
<D
>>
Iterate the carets between anchor and focus in a pre-order fashion
Type declaration
▸ (rootMode
): IterableIterator
<NodeCaret
<D
>>
Parameters
Name | Type |
---|---|
rootMode | RootMode |
Returns
IterableIterator
<NodeCaret
<D
>>
Defined in
packages/lexical/src/LexicalCaret.ts:100
isCollapsed
• isCollapsed: () => boolean
Return true if anchor and focus are the same caret
Type declaration
▸ (): boolean
Returns
boolean
Defined in
packages/lexical/src/LexicalCaret.ts:96
textSliceCarets
• textSliceCarets: () => [] | [TextSliceCaret
<TextNode
, D
>] | [TextSliceCaret
<TextNode
, D
>, TextSliceCaret
<TextNode
, D
>]
There are between zero and two TextSliceCarets for a NodeCaretRange
0: Neither anchor nor focus are non-empty TextSliceCarets 1: One of anchor or focus are non-empty TextSliceCaret, or of the same origin 2: Anchor and focus are both non-empty TextSliceCaret of different origin
Type declaration
▸ (): [] | [TextSliceCaret
<TextNode
, D
>] | [TextSliceCaret
<TextNode
, D
>, TextSliceCaret
<TextNode
, D
>]
Returns
[] | [TextSliceCaret
<TextNode
, D
>] | [TextSliceCaret
<TextNode
, D
>, TextSliceCaret
<TextNode
, D
>]
Defined in
packages/lexical/src/LexicalCaret.ts:108
type
• Readonly
type: "node-caret-range"
Defined in
packages/lexical/src/LexicalCaret.ts:91
Methods
[iterator]
▸ [iterator](): Iterator
<RangeNodeCaret
<D
>, any
, undefined
>
Returns
Iterator
<RangeNodeCaret
<D
>, any
, undefined
>
Inherited from
Iterable.[iterator]