/**
 * This module exports a set of classes for converting between DOM `Range`
 * objects and different types of selectors. It is mostly a thin wrapper around a
 * set of anchoring libraries. It serves two main purposes:
 *
 *  1. Providing a consistent interface across different types of anchors.
 *  2. Insulating the rest of the code from API changes in the underlying anchoring
 *     libraries.
 */
import type { MediaTimeSelector, RangeSelector, TextPositionSelector, TextQuoteSelector } from './api-types';
/**
 * Converts between `RangeSelector` selectors and `Range` objects.
 */
export declare class RangeAnchor {
    root: Node;
    range: Range;
    /**
     * @param root - A root element from which to anchor.
     * @param range - A range describing the anchor.
     */
    constructor(root: Node, range: Range);
    /**
     * @param root - A root element from which to anchor.
     * @param range - A range describing the anchor.
     */
    static fromRange(root: Node, range: Range): RangeAnchor;
    /**
     * Create an anchor from a serialized `RangeSelector` selector.
     *
     * @param root - A root element from which to anchor.
     */
    static fromSelector(root: Element, selector: RangeSelector): RangeAnchor;
    toRange(): Range;
    toSelector(): RangeSelector;
}
/**
 * Converts between `TextPositionSelector` selectors and `Range` objects.
 */
export declare class TextPositionAnchor {
    root: Element;
    start: number;
    end: number;
    constructor(root: Element, start: number, end: number);
    static fromRange(root: Element, range: Range): TextPositionAnchor;
    static fromSelector(root: Element, selector: TextPositionSelector): TextPositionAnchor;
    toSelector(): TextPositionSelector;
    toRange(): Range;
}
type QuoteMatchOptions = {
    /** Expected position of match in text. See `matchQuote`. */
    hint?: number;
};
export type TextQuoteAnchorContext = {
    prefix?: string;
    suffix?: string;
};
/**
 * Converts between `TextQuoteSelector` selectors and `Range` objects.
 */
export declare class TextQuoteAnchor {
    root: Element;
    exact: string;
    context: TextQuoteAnchorContext;
    /**
     * @param root - A root element from which to anchor.
     */
    constructor(root: Element, exact: string, context?: TextQuoteAnchorContext);
    /**
     * Create a `TextQuoteAnchor` from a range.
     *
     * Will throw if `range` does not contain any text nodes.
     */
    static fromRange(root: Element, range: Range): TextQuoteAnchor;
    static fromSelector(root: Element, selector: TextQuoteSelector): TextQuoteAnchor;
    toSelector(): TextQuoteSelector;
    toRange(options?: QuoteMatchOptions): Range;
    toPositionAnchor(options?: QuoteMatchOptions): TextPositionAnchor;
}
export declare class MediaTimeAnchor {
    root: Element;
    /** Offset from start of media in seconds. */
    start: number;
    /** Offset from end of media in seconds. */
    end: number;
    constructor(root: Element, start: number, end: number);
    /**
     * Return a {@link MediaTimeAnchor} that represents a range, or `null` if
     * no time range information is present on elements in the range.
     */
    static fromRange(root: Element, range: Range): MediaTimeAnchor | null;
    /**
     * Convert this anchor to a DOM range.
     *
     * This returned range will start from the beginning of the element whose
     * associated time range includes `start` and continue to the end of the
     * element whose associated time range includes `end`.
     */
    toRange(): Range;
    static fromSelector(root: Element, selector: MediaTimeSelector): MediaTimeAnchor;
    toSelector(): MediaTimeSelector;
}
export {};
