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:54

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: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

BaseSelection.group

Defined in

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


type

static type: string = 'text'

Overrides

BaseSelection.type

Defined in

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

Accessors

end

get end(): TextRangePoint

Returns

TextRangePoint

Defined in

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


group

get group(): string

Returns

string

Inherited from

BaseSelection.group

Defined in

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


start

get start(): TextRangePoint

Returns

TextRangePoint

Defined in

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


type

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:87


equals()

equals(other): boolean

Parameters

other: BaseSelection

Returns

boolean

Overrides

BaseSelection.equals

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

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: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

BaseSelection.toJSON

Defined in

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


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:65