package quill
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=a9a8a9787f8250337187bb7b21cb317c41bfd2ecf08bcfe0ab407c7b6660764d
sha512=fe13cf257c487e41efe2967be147d80fa94bac8996d3aab2b8fd16f0bbbd108c15e0e58c025ec9bf294d4a0d220ca2ba00c3b1b42fa2143f758c5f0ee4c15782
doc/quill.editor/Quill_editor/Brr_ext/Selection/index.html
Module Brr_ext.Selection
Selection
The type for Selection objects. Represents the currently selected text or the caret position.
to_jv sel
converts the selection object sel
to its underlying JavaScript value.
anchor_node sel
is the anchor node of the selection sel
(if any). This is the node where the user began the selection. Returns the raw JavaScript value (Jv.t
) for the node.
focus_node sel
is the focus node of the selection sel
(if any). This is the node where the user ended the selection. Returns the raw JavaScript value (Jv.t
) for the node.
anchor_offset sel
is the anchor offset of the selection sel
. This is the offset within the anchor_node
where the selection begins.
focus_offset sel
is the focus offset of the selection sel
. This is the offset within the focus_node
where the selection ends.
is_collapsed sel
gets the isCollapsed property of the selection sel
. Returns true
if the selection's start and end points are at the same position (i.e., it's a caret).
range_count sel
is the range count of the selection sel
. Typically, this is 1, even for a collapsed selection (caret).
get_range_at sel index
gets the Range object at the specified index
within the selection sel
. Most selections only have one range (at index 0).
add_range sel range
adds the given range
to the selection sel
.
remove_all_ranges sel
removes all ranges from the selection sel
, effectively deselecting any selected text.