API > @blocksuite/block-std > TextSelection
Class: TextSelection ​
Extends ​
Constructors ​
constructor ​
new TextSelection(
__namedParameters):TextSelection
Parameters ​
| Parameter | Type |
|---|---|
__namedParameters | TextSelectionProps |
Returns ​
Overrides ​
Defined In ​
block-std/src/selection/variants/text.ts:46
Properties ​
from ​
from:
TextRangePoint
Defined In ​
block-std/src/selection/variants/text.ts:40
isReverse ​
isReverse:
boolean
Defined In ​
block-std/src/selection/variants/text.ts:44
path ​
readonlypath:string[]
Defined In ​
block-std/src/selection/base.ts:16
Inherited from ​
to ​
to:
null|TextRangePoint
Defined In ​
block-std/src/selection/variants/text.ts:42
group ​
staticgroup:string='note'
Defined In ​
block-std/src/selection/variants/text.ts:38
Overrides ​
type ​
statictype:string='text'
Defined In ​
block-std/src/selection/variants/text.ts:37
Overrides ​
Accessors ​
blockId ​
getblockId():string
Defined In ​
block-std/src/selection/base.ts:22
Inherited from ​
end ​
getend():TextRangePoint
Defined In ​
block-std/src/selection/variants/text.ts:61
group ​
getgroup():string
Defined In ​
block-std/src/selection/base.ts:37
Inherited from ​
start ​
getstart():TextRangePoint
Defined In ​
block-std/src/selection/variants/text.ts:57
type ​
gettype(): keyofSelection
Defined In ​
block-std/src/selection/base.ts:32
Inherited from ​
Methods ​
_equalPoint ​
private_equalPoint(a,b):boolean
Parameters ​
| Parameter | Type |
|---|---|
a | null | TextRangePoint |
b | null | TextRangePoint |
Returns ​
boolean
Defined In ​
block-std/src/selection/variants/text.ts:69
empty ​
empty():
boolean
Returns ​
boolean
Defined In ​
block-std/src/selection/variants/text.ts:65
equals ​
equals(
other):boolean
Parameters ​
| Parameter | Type |
|---|---|
other | BaseSelection |
Returns ​
boolean
Overrides ​
Defined In ​
block-std/src/selection/variants/text.ts:84
is ​
is<
T>(type):this is SelectionInstance[T]
Type parameters ​
| Parameter |
|---|
T extends keyof Selection |
Parameters ​
| Parameter | Type |
|---|---|
type | T |
Returns ​
this is SelectionInstance[T]
Inherited from ​
Defined In ​
block-std/src/selection/base.ts:26
isCollapsed ​
isCollapsed():
boolean
Returns ​
boolean
Defined In ​
block-std/src/selection/variants/text.ts:112
isInSameBlock ​
isInSameBlock():
boolean
Returns ​
boolean
Defined In ​
block-std/src/selection/variants/text.ts:116
toJSON ​
toJSON():
Record<string,unknown>
Returns ​
Record< string, unknown >
Overrides ​
Defined In ​
block-std/src/selection/variants/text.ts:94
fromJSON ​
staticfromJSON(json):TextSelection
Parameters ​
| Parameter | Type |
|---|---|
json | Record< string, unknown > |
Returns ​
Overrides ​
Defined In ​
block-std/src/selection/variants/text.ts:103