Skip to content

API > @blocksuite/lit > RangeSynchronizer

Class: RangeSynchronizer ​

Two-way binding between native range and text selection

Constructors ​

constructor ​

new RangeSynchronizer(manager): RangeSynchronizer

Parameters ​

ParameterType
managerRangeManager

Returns ​

RangeSynchronizer

Defined In ​

packages/lit/src/utils/range-synchronizer.ts:48

Properties ​

_filter ​

private _filter: RangeSyncFilter = {}

Defined In ​

packages/lit/src/utils/range-synchronizer.ts:25


_isComposing ​

private _isComposing: boolean = false

Defined In ​

packages/lit/src/utils/range-synchronizer.ts:42


_prevSelection ​

private _prevSelection: null | BaseSelection = null

Defined In ​

packages/lit/src/utils/range-synchronizer.ts:23


manager ​

manager: RangeManager

Defined In ​

packages/lit/src/utils/range-synchronizer.ts:48

Accessors ​

_rangeManager ​

private get _rangeManager(): RangeManager

Defined In ​

packages/lit/src/utils/range-synchronizer.ts:37


_selectionManager ​

private get _selectionManager(): SelectionManager

Defined In ​

packages/lit/src/utils/range-synchronizer.ts:33


filter ​

get filter(): RangeSyncFilter

Defined In ​

packages/lit/src/utils/range-synchronizer.ts:26


root ​

get root(): BlockSuiteRoot

Defined In ​

packages/lit/src/utils/range-synchronizer.ts:44

Methods ​

_beforeTextInput ​

private _beforeTextInput(selection, event): void

Parameters ​

ParameterType
selectionTextSelection
eventInputEvent

Returns ​

void

Defined In ​

packages/lit/src/utils/range-synchronizer.ts:135


_onSelectionModelChanged ​

private _onSelectionModelChanged(selections): void

Parameters ​

ParameterType
selectionsBaseSelection[]

Returns ​

void

Defined In ​

packages/lit/src/utils/range-synchronizer.ts:104


_shamefullyResetIMERangeBeforeInput ​

private _shamefullyResetIMERangeBeforeInput( startText, startElement, from): void

Parameters ​

ParameterType
startTextText
startElementBlockElement< BaseBlockModel< object >, BlockService< BaseBlockModel< object > >, string >
fromTextRangePoint

Returns ​

void

Defined In ​

packages/lit/src/utils/range-synchronizer.ts:198


setFilter ​

setFilter(filter): void

Parameters ​

ParameterType
filterRangeSyncFilter

Returns ​

void

Defined In ​

packages/lit/src/utils/range-synchronizer.ts:29