Skip to main content

position

ai-research-agent / editor/rendering/position

Functions

getBoudingBrowserRange()

function getBoudingBrowserRange(editor, range): Range

Parameters

ParameterType

editor

Editor

range

EditorRange

Returns

Range


getBrowserRange()

function getBrowserRange(editor, range): Range

Parameters

ParameterType

editor

Editor

range

EditorRange

Returns

Range


getIndexFromNode()

function getIndexFromNode(editor, startNode): number

Parameters

ParameterType

editor

Editor

startNode

Node

Returns

number


getIndexFromNodeAndOffset()

function getIndexFromNodeAndOffset(
editor,
node,
offset,
current?): number

Parameters

ParameterType

editor

Editor

node

Node

offset

number

current?

null | number

Returns

number


getIndexFromPoint()

function getIndexFromPoint(
editor,
x,
y): null | number

Parameters

ParameterType

editor

Editor

x

number

y

number

Returns

null | number


getLineElementAt()

function getLineElementAt(editor, index): undefined | HTMLLineElement

Parameters

ParameterType

editor

Editor

index

number

Returns

undefined | HTMLLineElement


getLineInfoFromPoint()

function getLineInfoFromPoint(editor, y): LineInfo | undefined

Parameters

ParameterType

editor

Editor

y

number

Returns

LineInfo | undefined


getNodeAndOffset()

function getNodeAndOffset(
editor,
index,
direction): NodeOffsetAndFrozen

Parameters

ParameterType

editor

Editor

index

number

direction

0 | 1

Returns

NodeOffsetAndFrozen


getNodeLength()

function getNodeLength(editor, parentNode): number

Parameters

ParameterType

editor

Editor

parentNode

Node

Returns

number


getNodesForRange()

function getNodesForRange(editor, range): [Node | null, number, Node | null, number]

Parameters

ParameterType

editor

Editor

range

EditorRange

Returns

[Node | null, number, Node | null, number]


textNodeLength()

function textNodeLength(lines, node): number

Parameters

ParameterType

lines

Types<BasicType>

node

Node

Returns

number

Interfaces

LineInfo

Properties

belowMid
belowMid: boolean;
element
element: HTMLLineElement;
line
line: default;
rect
rect: DOMRect;