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:40
Properties ​
from ​
from:
TextRangePoint
Defined In ​
block-std/src/selection/variants/text.ts:36
path ​
readonly
path: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:38
group ​
static
group:string
='note'
Defined In ​
block-std/src/selection/variants/text.ts:34
Overrides ​
type ​
static
type:string
='text'
Defined In ​
block-std/src/selection/variants/text.ts:33
Overrides ​
Accessors ​
blockId ​
get
blockId():string
Defined In ​
block-std/src/selection/base.ts:22
Inherited from ​
group ​
get
group():string
Defined In ​
block-std/src/selection/base.ts:37
Inherited from ​
type ​
get
type(): 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:53
empty ​
empty():
boolean
Returns ​
boolean
Defined In ​
block-std/src/selection/variants/text.ts:49
equals ​
equals(
other
):boolean
Parameters ​
Parameter | Type |
---|---|
other | BaseSelection |
Returns ​
boolean
Overrides ​
Defined In ​
block-std/src/selection/variants/text.ts:68
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:94
isInSameBlock ​
isInSameBlock():
boolean
Returns ​
boolean
Defined In ​
block-std/src/selection/variants/text.ts:98
toJSON ​
toJSON():
Record
<string
,unknown
>
Returns ​
Record
< string
, unknown
>
Overrides ​
Defined In ​
block-std/src/selection/variants/text.ts:78
fromJSON ​
static
fromJSON(json
):TextSelection
Parameters ​
Parameter | Type |
---|---|
json | Record < string , unknown > |
Returns ​
Overrides ​
Defined In ​
block-std/src/selection/variants/text.ts:86