/**
 * Utility functions for manipulating ranges of highlightable content.
 */
import type { DOMRange } from "./types";
/**
 * Given two DOMRanges, return a DOMRange whose start point comes from A, and
 * whose end point comes from B.
 */
export declare function spanRanges(a: DOMRange, b: DOMRange): DOMRange;
/**
 * Given two DOMRanges, return whether they overlap.
 *
 * We here treat ranges like closed intervals: the boundary points are
 * considered to be included in the range, and, if a ends exactly where b
 * starts, they are considered to overlap.
 */
export declare function rangesOverlap(a: DOMRange, b: DOMRange): boolean;
/**
 * Given two DOMRanges, return whether the first includes the second: whether
 * all points that B contains are also contained by A.
 */
export declare function rangeIncludes(a: DOMRange, b: DOMRange): boolean;
/**
 * Given two DOMRanges, intersect them: return a range that contains all points
 * that both A contains and B contains, and contains no other points.
 *
 * If A and B do not overlap, no intersection exists; return null.
 */
export declare function intersectRanges(a: DOMRange, b: DOMRange): DOMRange | null | undefined;
/**
 * Given two DOMRanges, union them: return a range that contains all points
 * that either A contains or B contains, and contains no other points.
 *
 * If A and B do not overlap, no union exists; return null.
 */
export declare function unionRanges(a: DOMRange, b: DOMRange): DOMRange | null | undefined;
/**
 * Given a list of word ranges, and a selection range, binary search the list
 * and return the indexes of the first and last words that the selection
 * intersects, or `null` if the range includes no words.
 */
export declare function findFirstAndLastWordIndexes(selectionRange: DOMRange, wordRanges: ReadonlyArray<DOMRange>): [number, number] | null | undefined;
