Skip to main content

Class: OffsetView

@lexical/offset.OffsetView

Constructors

constructor

new OffsetView(offsetMap, firstNode, blockOffsetSize?): OffsetView

Parameters

NameTypeDefault value
offsetMapOffsetMapundefined
firstNodenull | OffsetNodeundefined
blockOffsetSizenumber1

Returns

OffsetView

Defined in

packages/lexical-offset/src/index.ts:65

Properties

_blockOffsetSize

_blockOffsetSize: number

Defined in

packages/lexical-offset/src/index.ts:63


_firstNode

_firstNode: null | OffsetNode

Defined in

packages/lexical-offset/src/index.ts:62


_offsetMap

_offsetMap: OffsetMap

Defined in

packages/lexical-offset/src/index.ts:61

Methods

createSelectionFromOffsets

createSelectionFromOffsets(originalStart, originalEnd, diffOffsetView?): null | RangeSelection

Parameters

NameType
originalStartnumber
originalEndnumber
diffOffsetView?OffsetView

Returns

null | RangeSelection

Defined in

packages/lexical-offset/src/index.ts:75


getOffsetsFromSelection

getOffsetsFromSelection(selection): [number, number]

Parameters

NameType
selectionRangeSelection

Returns

[number, number]

Defined in

packages/lexical-offset/src/index.ts:189