package quill

  1. Overview
  2. Docs

Module Brr_ext.Range

Range

Sourcetype t

The type for Range objects. Represents a contiguous part of a document.

Sourceval of_jv : Jv.t -> t

of_jv jv converts the JavaScript value jv to a range object.

Sourceval to_jv : t -> Jv.t

to_jv r converts the range object r to its underlying JavaScript value.

Sourceval start_container : t -> Jv.t

start_container r is the start container node of the range r. Returns the raw JavaScript value (Jv.t) for the node.

Sourceval end_container : t -> Jv.t

end_container r is the end container node of the range r. Returns the raw JavaScript value (Jv.t) for the node.

Sourceval common_ancestor_container : t -> Jv.t

common_ancestor_container r is the deepest node that contains both the start and end containers of the range r. See commonAncestorContainer. Returns the raw JavaScript value (Jv.t) for the node.

Sourceval start_offset : t -> int

start_offset r is the offset within the start_container where the range r begins. See startOffset.

Sourceval end_offset : t -> int

end_offset r is the offset within the end_container where the range r ends. See endOffset.

Sourceval collapsed : t -> bool

collapsed r is the collapsed state of the range r. Returns true if the range's start and end points are the same.

Sourceval set_start : t -> Jv.t -> int -> unit

set_start r node_jv offset sets the start of the range r to offset within the node represented by the raw JavaScript value node_jv.

Sourceval set_end : t -> Jv.t -> int -> unit

set_end r node_jv offset sets the end of the range r to offset within the node represented by the raw JavaScript value node_jv.

Sourceval set_start_before : t -> Jv.t -> unit

set_start_before r node_jv sets the start of the range r to be immediately before the node represented by the raw JavaScript value node_jv.

Sourceval set_start_after : t -> Jv.t -> unit

set_start_after r node_jv sets the start of the range r to be immediately after the node represented by the raw JavaScript value node_jv.

Sourceval collapse : t -> bool -> unit

collapse r to_start collapses the range r to one of its boundary points. If to_start is true, collapses to the start point; otherwise, collapses to the end point.

Sourceval select_node : t -> Jv.t -> unit

select_node r node_jv sets the range r to contain the node represented by the raw JavaScript value node_jv and all of its contents.

Sourceval select_node_contents : t -> Jv.t -> unit

select_node_contents r node_jv sets the range r to contain the contents within the node represented by the raw JavaScript value node_jv.

Sourceval delete_contents : t -> unit

delete_contents r deletes the contents of the range r. This removes the selected text from the document.

Sourceval clone : t -> t

clone r creates a copy of the range r. This is a new range object with the same start and end points.

Sourceval to_string : t -> Jstr.t

to_string r gets the string representation of the range r. This is the text content of the range.

OCaml

Innovation. Community. Security.