BlockSuite API Documentation / @blocksuite/block-std / TextSelection
Class: TextSelection
Extends
Constructors
new TextSelection(__namedParameters)
new TextSelection(
__namedParameters
):TextSelection
Parameters
• __namedParameters: TextSelectionProps
Returns
Overrides
Source
block-std/src/selection/variants/text.ts:46
Properties
from
from:
TextRangePoint
Source
block-std/src/selection/variants/text.ts:40
path
readonly
path:string
[]
Inherited from
Source
block-std/src/selection/base.ts:16
reverse
reverse:
boolean
Source
block-std/src/selection/variants/text.ts:44
to
to:
null
|TextRangePoint
Source
block-std/src/selection/variants/text.ts:42
group
static
group:string
='note'
Overrides
Source
block-std/src/selection/variants/text.ts:38
type
static
type:string
='text'
Overrides
Source
block-std/src/selection/variants/text.ts:37
Accessors
blockId
get
blockId():string
Returns
string
Source
block-std/src/selection/base.ts:22
end
get
end():TextRangePoint
Returns
Source
block-std/src/selection/variants/text.ts:61
group
get
group():string
Returns
string
Source
block-std/src/selection/base.ts:37
start
get
start():TextRangePoint
Returns
Source
block-std/src/selection/variants/text.ts:57
type
get
type(): keyofSelection
Returns
keyof Selection
Source
block-std/src/selection/base.ts:32
Methods
_equalPoint()
private
_equalPoint(a
,b
):boolean
Parameters
• a: null
| TextRangePoint
• b: null
| TextRangePoint
Returns
boolean
Source
block-std/src/selection/variants/text.ts:69
empty()
empty():
boolean
Returns
boolean
Source
block-std/src/selection/variants/text.ts:65
equals()
equals(
other
):boolean
Parameters
• other: BaseSelection
Returns
boolean
Overrides
Source
block-std/src/selection/variants/text.ts:84
is()
is<
T
>(type
):this is SelectionInstance[T]
Type parameters
• T extends keyof Selection
Parameters
• type: T
Returns
this is SelectionInstance[T]
Inherited from
Source
block-std/src/selection/base.ts:26
isCollapsed()
isCollapsed():
boolean
Returns
boolean
Source
block-std/src/selection/variants/text.ts:112
isInSameBlock()
isInSameBlock():
boolean
Returns
boolean
Source
block-std/src/selection/variants/text.ts:116
toJSON()
toJSON():
Record
<string
,unknown
>
Returns
Record
<string
, unknown
>
Overrides
Source
block-std/src/selection/variants/text.ts:94
fromJSON()
static
fromJSON(json
):TextSelection
Parameters
• json: Record
<string
, unknown
>
Returns
Overrides
Source
block-std/src/selection/variants/text.ts:103