Skip to main content

$caretRangeFromSelection

function

Get a pair of carets for a RangeSelection. If the focus is before the anchor, then the direction will be 'previous', otherwise the direction will be 'next'.

function $caretRangeFromSelection(selection: RangeSelection): CaretRange

Import

import { $caretRangeFromSelection } from '@modular/sdk/editor';