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

Source

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

Properties

blockId

readonly blockId: string

Inherited from

BaseSelection.blockId

Source

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


from

from: TextRangePoint

Source

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


reverse

reverse: boolean

Source

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


to

to: null | TextRangePoint

Source

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


group

static group: string = 'note'

Overrides

BaseSelection.group

Source

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


type

static type: string = 'text'

Overrides

BaseSelection.type

Source

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

Accessors

end

get end(): TextRangePoint

Returns

TextRangePoint

Source

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


group

get group(): string

Returns

string

Source

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


start

get start(): TextRangePoint

Returns

TextRangePoint

Source

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


type

get type(): keyof Selection

Returns

keyof Selection

Source

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

Methods

_equalPoint()

private _equalPoint(a, b): boolean

Parameters

a: null | TextRangePoint

b: null | TextRangePoint

Returns

boolean

Source

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


empty()

empty(): boolean

Returns

boolean

Source

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


equals()

equals(other): boolean

Parameters

other: BaseSelection

Returns

boolean

Overrides

BaseSelection.equals

Source

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


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

Source

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


isCollapsed()

isCollapsed(): boolean

Returns

boolean

Source

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


isInSameBlock()

isInSameBlock(): boolean

Returns

boolean

Source

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


toJSON()

toJSON(): Record<string, unknown>

Returns

Record<string, unknown>

Overrides

BaseSelection.toJSON

Source

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


fromJSON()

static fromJSON(json): TextSelection

Parameters

json: Record<string, unknown>

Returns

TextSelection

Overrides

BaseSelection.fromJSON

Source

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