Skip to content

API > @blocksuite/block-std > TextSelection

Class: TextSelection ​

Extends ​

Constructors ​

constructor ​

new TextSelection(__namedParameters): TextSelection

Parameters ​

ParameterType
__namedParametersTextSelectionProps

Returns ​

TextSelection

Overrides ​

BaseSelection.constructor

Defined In ​

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

Properties ​

from ​

from: TextRangePoint

Defined In ​

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


isReverse ​

isReverse: boolean

Defined In ​

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


path ​

readonly path: string[]

Defined In ​

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

Inherited from ​

BaseSelection.path


to ​

to: null | TextRangePoint

Defined In ​

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


group ​

static group: string = 'note'

Defined In ​

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

Overrides ​

BaseSelection.group


type ​

static type: string = 'text'

Defined In ​

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

Overrides ​

BaseSelection.type

Accessors ​

blockId ​

get blockId(): string

Defined In ​

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

Inherited from ​

BaseSelection.blockId


end ​

get end(): TextRangePoint

Defined In ​

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


group ​

get group(): string

Defined In ​

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

Inherited from ​

BaseSelection.group


start ​

get start(): TextRangePoint

Defined In ​

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


type ​

get type(): keyof Selection

Defined In ​

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

Inherited from ​

BaseSelection.type

Methods ​

_equalPoint ​

private _equalPoint(a, b): boolean

Parameters ​

ParameterType
anull | TextRangePoint
bnull | TextRangePoint

Returns ​

boolean

Defined In ​

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


empty ​

empty(): boolean

Returns ​

boolean

Defined In ​

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


equals ​

equals(other): boolean

Parameters ​

ParameterType
otherBaseSelection

Returns ​

boolean

Overrides ​

BaseSelection.equals

Defined In ​

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


is ​

is<T>(type): this is SelectionInstance[T]

Type parameters ​

Parameter
T extends keyof Selection

Parameters ​

ParameterType
typeT

Returns ​

this is SelectionInstance[T]

Inherited from ​

BaseSelection.is

Defined In ​

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


isCollapsed ​

isCollapsed(): boolean

Returns ​

boolean

Defined In ​

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


isInSameBlock ​

isInSameBlock(): boolean

Returns ​

boolean

Defined In ​

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


toJSON ​

toJSON(): Record< string, unknown >

Returns ​

Record< string, unknown >

Overrides ​

BaseSelection.toJSON

Defined In ​

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


fromJSON ​

static fromJSON(json): TextSelection

Parameters ​

ParameterType
jsonRecord< string, unknown >

Returns ​

TextSelection

Overrides ​

BaseSelection.fromJSON

Defined In ​

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