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

Properties

blockId

readonly blockId: string

Inherited from

BaseSelection.blockId

Source

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


from

from: TextRangePoint

Source

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


reverse

reverse: boolean

Source

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


to

to: null | TextRangePoint

Source

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


group

static group: string = 'note'

Overrides

BaseSelection.group

Source

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


type

static type: string = 'text'

Overrides

BaseSelection.type

Source

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

Accessors

end

get end(): TextRangePoint

Returns

TextRangePoint

Source

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


group

get group(): string

Returns

string

Source

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


start

get start(): TextRangePoint

Returns

TextRangePoint

Source

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


type

get type(): keyof Selection

Returns

keyof Selection

Source

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

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


empty()

empty(): boolean

Returns

boolean

Source

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


equals()

equals(other): boolean

Parameters

other: BaseSelection

Returns

boolean

Overrides

BaseSelection.equals

Source

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


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


isCollapsed()

isCollapsed(): boolean

Returns

boolean

Source

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


isInSameBlock()

isInSameBlock(): boolean

Returns

boolean

Source

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


toJSON()

toJSON(): Record<string, unknown>

Returns

Record<string, unknown>

Overrides

BaseSelection.toJSON

Source

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


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