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

Properties ​

from ​

from: TextRangePoint

Defined In ​

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


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


group ​

static group: string = 'note'

Defined In ​

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

Overrides ​

BaseSelection.group


type ​

static type: string = 'text'

Defined In ​

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

Overrides ​

BaseSelection.type

Accessors ​

blockId ​

get blockId(): string

Defined In ​

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

Inherited from ​

BaseSelection.blockId


group ​

get group(): string

Defined In ​

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

Inherited from ​

BaseSelection.group


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


empty ​

empty(): boolean

Returns ​

boolean

Defined In ​

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


equals ​

equals(other): boolean

Parameters ​

ParameterType
otherBaseSelection

Returns ​

boolean

Overrides ​

BaseSelection.equals

Defined In ​

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


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


isInSameBlock ​

isInSameBlock(): boolean

Returns ​

boolean

Defined In ​

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


toJSON ​

toJSON(): Record< string, unknown >

Returns ​

Record< string, unknown >

Overrides ​

BaseSelection.toJSON

Defined In ​

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


fromJSON ​

static fromJSON(json): TextSelection

Parameters ​

ParameterType
jsonRecord< string, unknown >

Returns ​

TextSelection

Overrides ​

BaseSelection.fromJSON

Defined In ​

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