Skip to main content

$isExtendableTextPointCaret

function

Determine whether the TextPointCaret's offset can be extended further without leaving the TextNode. Returns false if the given caret is not a TextPointCaret or the offset can not be moved further in direction.

function $isExtendableTextPointCaret<D extends CaretDirection>(caret: PointCaret<D>): caret is TextPointCaret<TextNode, D> & { [PointCaretIsExtendableBrand]: never; }

Import

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

Notes

returns
true if caret is a TextPointCaret with an offset that is not at the end of the text given the direction.