BlockSuite API Documentation / @blocksuite/block-std / TextSelection
Class: TextSelection
Extends
Constructors
new TextSelection()
new TextSelection(
__namedParameters
):TextSelection
Parameters
• __namedParameters: TextSelectionProps
Returns
Overrides
Source
packages/framework/block-std/src/selection/variants/text.ts:45
Properties
blockId
readonly
blockId:string
Inherited from
Source
packages/framework/block-std/src/selection/base.ts:14
from
from:
TextRangePoint
Source
packages/framework/block-std/src/selection/variants/text.ts:39
reverse
reverse:
boolean
Source
packages/framework/block-std/src/selection/variants/text.ts:43
to
to:
null
|TextRangePoint
Source
packages/framework/block-std/src/selection/variants/text.ts:41
group
static
group:string
='note'
Overrides
Source
packages/framework/block-std/src/selection/variants/text.ts:37
type
static
type:string
='text'
Overrides
Source
packages/framework/block-std/src/selection/variants/text.ts:36
Accessors
end
get
end():TextRangePoint
Returns
Source
packages/framework/block-std/src/selection/variants/text.ts:60
group
get
group():string
Returns
string
Source
packages/framework/block-std/src/selection/base.ts:31
start
get
start():TextRangePoint
Returns
Source
packages/framework/block-std/src/selection/variants/text.ts:56
type
get
type(): keyofSelection
Returns
keyof Selection
Source
packages/framework/block-std/src/selection/base.ts:26
Methods
_equalPoint()
private
_equalPoint(a
,b
):boolean
Parameters
• a: null
| TextRangePoint
• b: null
| TextRangePoint
Returns
boolean
Source
packages/framework/block-std/src/selection/variants/text.ts:68
empty()
empty():
boolean
Returns
boolean
Source
packages/framework/block-std/src/selection/variants/text.ts:64
equals()
equals(
other
):boolean
Parameters
• other: BaseSelection
Returns
boolean
Overrides
Source
packages/framework/block-std/src/selection/variants/text.ts:81
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
packages/framework/block-std/src/selection/base.ts:20
isCollapsed()
isCollapsed():
boolean
Returns
boolean
Source
packages/framework/block-std/src/selection/variants/text.ts:109
isInSameBlock()
isInSameBlock():
boolean
Returns
boolean
Source
packages/framework/block-std/src/selection/variants/text.ts:113
toJSON()
toJSON():
Record
<string
,unknown
>
Returns
Record
<string
, unknown
>
Overrides
Source
packages/framework/block-std/src/selection/variants/text.ts:91
fromJSON()
static
fromJSON(json
):TextSelection
Parameters
• json: Record
<string
, unknown
>
Returns
Overrides
Source
packages/framework/block-std/src/selection/variants/text.ts:100