Skip to content

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

Class: TextSelection

Defined in: packages/framework/block-std/src/selection/variants/text.ts:34

Extends

Constructors

new TextSelection()

new TextSelection(__namedParameters): TextSelection

Defined in: packages/framework/block-std/src/selection/variants/text.ts:53

Parameters

__namedParameters

TextSelectionProps

Returns

TextSelection

Overrides

BaseSelection.constructor

Properties

blockId

readonly blockId: string

Defined in: packages/framework/store/dist/extension/selection/base.d.ts:8

Inherited from

BaseSelection.blockId


from

from: TextRangePoint

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


reverse

reverse: boolean

Defined in: packages/framework/block-std/src/selection/variants/text.ts:41


to

to: null | TextRangePoint

Defined in: packages/framework/block-std/src/selection/variants/text.ts:43


group

static group: string = 'note'

Defined in: packages/framework/block-std/src/selection/variants/text.ts:35

Overrides

BaseSelection.group


type

static type: string = 'text'

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

Overrides

BaseSelection.type

Accessors

end

Get Signature

get end(): TextRangePoint

Defined in: packages/framework/block-std/src/selection/variants/text.ts:45

Returns

TextRangePoint


group

Get Signature

get group(): string

Defined in: packages/framework/store/dist/extension/selection/base.d.ts:9

Returns

string

Inherited from

BaseSelection.group


start

Get Signature

get start(): TextRangePoint

Defined in: packages/framework/block-std/src/selection/variants/text.ts:49

Returns

TextRangePoint


type

Get Signature

get type(): string

Defined in: packages/framework/store/dist/extension/selection/base.d.ts:10

Returns

string

Inherited from

BaseSelection.type

Methods

empty()

empty(): boolean

Defined in: packages/framework/block-std/src/selection/variants/text.ts:82

Returns

boolean


equals()

equals(other): boolean

Defined in: packages/framework/block-std/src/selection/variants/text.ts:86

Parameters

other

BaseSelection

Returns

boolean

Overrides

BaseSelection.equals


is()

is<T>(type): this is T extends SelectionConstructor<U> ? U : never

Defined in: packages/framework/store/dist/extension/selection/base.d.ts:14

Type Parameters

T

T extends SelectionConstructor<BaseSelection>

Parameters

type

T

Returns

this is T extends SelectionConstructor<U> ? U : never

Inherited from

BaseSelection.is


isCollapsed()

isCollapsed(): boolean

Defined in: packages/framework/block-std/src/selection/variants/text.ts:97

Returns

boolean


isInSameBlock()

isInSameBlock(): boolean

Defined in: packages/framework/block-std/src/selection/variants/text.ts:101

Returns

boolean


toJSON()

toJSON(): Record<string, unknown>

Defined in: packages/framework/block-std/src/selection/variants/text.ts:105

Returns

Record<string, unknown>

Overrides

BaseSelection.toJSON


fromJSON()

static fromJSON(json): TextSelection

Defined in: packages/framework/block-std/src/selection/variants/text.ts:64

Parameters

json

Record<string, unknown>

Returns

TextSelection

Overrides

BaseSelection.fromJSON