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

@blocksuite/block-std.BaseSelection.constructor

Source

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

Properties

from

from: TextRangePoint

Source

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


isReverse

isReverse: boolean

Source

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


path

readonly path: string[]

Inherited from

@blocksuite/block-std.BaseSelection.path

Source

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


to

to: null | TextRangePoint

Source

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


group

static group: string = 'note'

Overrides

@blocksuite/block-std.BaseSelection.group

Source

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


type

static type: string = 'text'

Overrides

@blocksuite/block-std.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

@blocksuite/block-std.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

@blocksuite/block-std.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

@blocksuite/block-std.BaseSelection.toJSON

Source

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


fromJSON()

static fromJSON(json): TextSelection

Parameters

json: Record<string, unknown>

Returns

TextSelection

Overrides

@blocksuite/block-std.BaseSelection.fromJSON

Source

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


Generated using TypeDoc and typedoc-plugin-markdown.