Skip to content

BlockSuite API Documentation / @blocksuite/block-std / TextSelection

Class: TextSelection

Extends

Constructors

new TextSelection()

new TextSelection(__namedParameters): TextSelection

Parameters

__namedParameters

TextSelectionProps

Returns

TextSelection

Overrides

BaseSelection.constructor

Defined in

packages/framework/block-std/src/selection/variants/text.ts:55

Properties

blockId

readonly blockId: string

Inherited from

BaseSelection.blockId

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

BaseSelection.group

Defined in

packages/framework/block-std/src/selection/variants/text.ts:37


type

static type: string = 'text'

Overrides

BaseSelection.type

Defined in

packages/framework/block-std/src/selection/variants/text.ts:39

Accessors

end

Get Signature

get end(): TextRangePoint

Returns

TextRangePoint

Defined in

packages/framework/block-std/src/selection/variants/text.ts:47


group

Get Signature

get group(): string

Returns

string

Inherited from

BaseSelection.group

Defined in

packages/framework/block-std/src/selection/base.ts:20


start

Get Signature

get start(): TextRangePoint

Returns

TextRangePoint

Defined in

packages/framework/block-std/src/selection/variants/text.ts:51


type

Get Signature

get type(): keyof Selection

Returns

keyof Selection

Inherited from

BaseSelection.type

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

BaseSelection.equals

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

BaseSelection.is

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

BaseSelection.toJSON

Defined in

packages/framework/block-std/src/selection/variants/text.ts:107


fromJSON()

static fromJSON(json): TextSelection

Parameters

json

Record<string, unknown>

Returns

TextSelection

Overrides

BaseSelection.fromJSON

Defined in

packages/framework/block-std/src/selection/variants/text.ts:66