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
readonlyblockId: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
staticgroup:string='note'
Overrides
Source
packages/framework/block-std/src/selection/variants/text.ts:37
type
statictype:string='text'
Overrides
Source
packages/framework/block-std/src/selection/variants/text.ts:36
Accessors
end
getend():TextRangePoint
Returns
Source
packages/framework/block-std/src/selection/variants/text.ts:60
group
getgroup():string
Returns
string
Source
packages/framework/block-std/src/selection/base.ts:31
start
getstart():TextRangePoint
Returns
Source
packages/framework/block-std/src/selection/variants/text.ts:56
type
gettype(): 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()
staticfromJSON(json):TextSelection
Parameters
• json: Record<string, unknown>
Returns
Overrides
Source
packages/framework/block-std/src/selection/variants/text.ts:100