Skip to content

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

Class: TextSelection

Extends

Constructors

new TextSelection(__namedParameters)

new TextSelection(__namedParameters): TextSelection

Parameters

__namedParameters: TextSelectionProps

Returns

TextSelection

Overrides

BaseSelection.constructor

Source

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

Properties

from

from: TextRangePoint

Source

block-std/src/selection/variants/text.ts:40


path

readonly path: string[]

Inherited from

BaseSelection.path

Source

block-std/src/selection/base.ts:16


reverse

reverse: boolean

Source

block-std/src/selection/variants/text.ts:44


to

to: null | TextRangePoint

Source

block-std/src/selection/variants/text.ts:42


group

static group: string = 'note'

Overrides

BaseSelection.group

Source

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


type

static type: string = 'text'

Overrides

BaseSelection.type

Source

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

Accessors

blockId

get blockId(): string

Returns

string

Source

block-std/src/selection/base.ts:22


end

get end(): TextRangePoint

Returns

TextRangePoint

Source

block-std/src/selection/variants/text.ts:61


group

get group(): string

Returns

string

Source

block-std/src/selection/base.ts:37


start

get start(): TextRangePoint

Returns

TextRangePoint

Source

block-std/src/selection/variants/text.ts:57


type

get type(): keyof Selection

Returns

keyof Selection

Source

block-std/src/selection/base.ts:32

Methods

_equalPoint()

private _equalPoint(a, b): boolean

Parameters

a: null | TextRangePoint

b: null | TextRangePoint

Returns

boolean

Source

block-std/src/selection/variants/text.ts:69


empty()

empty(): boolean

Returns

boolean

Source

block-std/src/selection/variants/text.ts:65


equals()

equals(other): boolean

Parameters

other: BaseSelection

Returns

boolean

Overrides

BaseSelection.equals

Source

block-std/src/selection/variants/text.ts:84


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

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


isCollapsed()

isCollapsed(): boolean

Returns

boolean

Source

block-std/src/selection/variants/text.ts:112


isInSameBlock()

isInSameBlock(): boolean

Returns

boolean

Source

block-std/src/selection/variants/text.ts:116


toJSON()

toJSON(): Record<string, unknown>

Returns

Record<string, unknown>

Overrides

BaseSelection.toJSON

Source

block-std/src/selection/variants/text.ts:94


fromJSON()

static fromJSON(json): TextSelection

Parameters

json: Record<string, unknown>

Returns

TextSelection

Overrides

BaseSelection.fromJSON

Source

block-std/src/selection/variants/text.ts:103