BlockSuite API Documentation / @blocksuite/block-std / TextSelection
Class: TextSelection
Extends
Constructors
new TextSelection()
new TextSelection(
__namedParameters
):TextSelection
Parameters
• __namedParameters: TextSelectionProps
Returns
Overrides
Defined in
packages/framework/block-std/src/selection/variants/text.ts:54
Properties
blockId
readonly
blockId:string
Inherited from
Defined in
packages/framework/block-std/src/selection/base.ts:18
from
from:
TextRangePoint
Defined in
packages/framework/block-std/src/selection/variants/text.ts:40
reverse
reverse:
boolean
Defined in
packages/framework/block-std/src/selection/variants/text.ts:42
to
to:
null
|TextRangePoint
Defined in
packages/framework/block-std/src/selection/variants/text.ts:44
group
static
group:string
='note'
Overrides
Defined in
packages/framework/block-std/src/selection/variants/text.ts:36
type
static
type:string
='text'
Overrides
Defined in
packages/framework/block-std/src/selection/variants/text.ts:38
Accessors
end
get
end():TextRangePoint
Returns
Defined in
packages/framework/block-std/src/selection/variants/text.ts:46
group
get
group():string
Returns
string
Inherited from
Defined in
packages/framework/block-std/src/selection/base.ts:20
start
get
start():TextRangePoint
Returns
Defined in
packages/framework/block-std/src/selection/variants/text.ts:50
type
get
type(): keyofSelection
Returns
keyof Selection
Inherited from
Defined in
packages/framework/block-std/src/selection/base.ts:24
Methods
empty()
empty():
boolean
Returns
boolean
Defined in
packages/framework/block-std/src/selection/variants/text.ts:87
equals()
equals(
other
):boolean
Parameters
• other: BaseSelection
Returns
boolean
Overrides
Defined in
packages/framework/block-std/src/selection/variants/text.ts:91
is()
is<
T
>(type
):this is SelectionInstance[T]
Type Parameters
• T extends keyof Selection
Parameters
• type: T
Returns
this is SelectionInstance[T]
Inherited from
Defined in
packages/framework/block-std/src/selection/base.ts:42
isCollapsed()
isCollapsed():
boolean
Returns
boolean
Defined in
packages/framework/block-std/src/selection/variants/text.ts:102
isInSameBlock()
isInSameBlock():
boolean
Returns
boolean
Defined in
packages/framework/block-std/src/selection/variants/text.ts:106
toJSON()
toJSON():
Record
<string
,unknown
>
Returns
Record
<string
, unknown
>
Overrides
Defined in
packages/framework/block-std/src/selection/variants/text.ts:110
fromJSON()
static
fromJSON(json
):TextSelection
Parameters
• json: Record
<string
, unknown
>
Returns
Overrides
Defined in
packages/framework/block-std/src/selection/variants/text.ts:65