@jsvision/code-editor / documentSelection
Function: documentSelection()
documentSelection(
value,length):DocumentSelection
Defined in: code-editor/src/document/types.ts:282
Normalizes a public selection input into trusted document offsets.
Parameters
value
length
number
Returns
Example
ts
const caret = documentSelection({ anchor: 2, head: 2 }, snapshot.length);