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:55
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:41
reverse
reverse:
boolean
Defined in
packages/framework/block-std/src/selection/variants/text.ts:43
to
to:
null
|TextRangePoint
Defined in
packages/framework/block-std/src/selection/variants/text.ts:45
group
static
group:string
='note'
Overrides
Defined in
packages/framework/block-std/src/selection/variants/text.ts:37
type
static
type:string
='text'
Overrides
Defined in
packages/framework/block-std/src/selection/variants/text.ts:39
Accessors
end
get
end():TextRangePoint
Returns
Defined in
packages/framework/block-std/src/selection/variants/text.ts:47
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:51
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:84
equals()
equals(
other
):boolean
Parameters
• other: BaseSelection
Returns
boolean
Overrides
Defined in
packages/framework/block-std/src/selection/variants/text.ts:88
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:99
isInSameBlock()
isInSameBlock():
boolean
Returns
boolean
Defined in
packages/framework/block-std/src/selection/variants/text.ts:103
toJSON()
toJSON():
Record
<string
,unknown
>
Returns
Record
<string
, unknown
>
Overrides
Defined in
packages/framework/block-std/src/selection/variants/text.ts:107
fromJSON()
static
fromJSON(json
):TextSelection
Parameters
• json: Record
<string
, unknown
>
Returns
Overrides
Defined in
packages/framework/block-std/src/selection/variants/text.ts:66