/**
 * RangeSerializer - Serialize and deserialize DOM Range objects
 *
 * Provides utilities for storing and restoring text ranges across sessions.
 * Used by both TTS (for timing data) and annotations (for persistence).
 *
 * Uses CSS selector paths and node indices for robust serialization that
 * survives content changes when possible.
 */
/**
 * Serialized form of a Range suitable for storage.
 */
export interface SerializedRange {
    /** CSS selector path to start container */
    startContainer: string;
    /** Character offset in start container */
    startOffset: number;
    /** CSS selector path to end container */
    endContainer: string;
    /** Character offset in end container */
    endOffset: number;
    /** Original text for validation */
    text: string;
    /** Optional metadata */
    metadata?: {
        /** When this range was created */
        timestamp?: number;
        /** User-provided label */
        label?: string;
        /** Custom data */
        custom?: Record<string, unknown>;
    };
}
/**
 * RangeSerializer - Serialize and deserialize Range objects.
 */
export declare class RangeSerializer {
    /**
     * Serialize a Range to storable format.
     *
     * @param range - Range to serialize
     * @param root - Root element (typically document.body or content container)
     * @returns Serialized range data
     *
     * @example
     * ```typescript
     * const serializer = new RangeSerializer();
     * const range = window.getSelection()!.getRangeAt(0);
     * const serialized = serializer.serialize(range, document.body);
     * localStorage.setItem('savedRange', JSON.stringify(serialized));
     * ```
     */
    serialize(range: Range, root: Element): SerializedRange;
    /**
     * Deserialize range from storage.
     *
     * @param data - Serialized range data
     * @param root - Root element (same as used in serialize)
     * @returns Range object, or null if content changed
     *
     * @example
     * ```typescript
     * const serializer = new RangeSerializer();
     * const data = JSON.parse(localStorage.getItem('savedRange')!);
     * const range = serializer.deserialize(data, document.body);
     * if (range) {
     *   // Range successfully restored
     * } else {
     *   // Content changed, range invalid
     * }
     * ```
     */
    deserialize(data: SerializedRange, root: Element): Range | null;
    /**
     * Get a unique path to a node from root.
     *
     * Uses a hybrid approach:
     * - For element nodes: CSS selector path
     * - For text nodes: parent selector + text node index
     *
     * @param node - Node to get path for
     * @param root - Root element
     * @returns Path string
     */
    private getNodePath;
    /**
     * Get CSS selector path to an element.
     *
     * @param element - Element to get path for
     * @param root - Root element
     * @returns CSS selector path
     */
    private getElementPath;
    /**
     * Find a node by its path from root.
     *
     * @param path - Path string from getNodePath
     * @param root - Root element
     * @returns Node, or null if not found
     */
    private findNodeByPath;
    /**
     * Batch serialize multiple ranges.
     *
     * @param ranges - Ranges to serialize
     * @param root - Root element
     * @returns Array of serialized ranges
     */
    serializeMany(ranges: Range[], root: Element): SerializedRange[];
    /**
     * Batch deserialize multiple ranges.
     *
     * @param data - Array of serialized ranges
     * @param root - Root element
     * @returns Array of ranges (nulls for invalid ranges)
     */
    deserializeMany(data: SerializedRange[], root: Element): (Range | null)[];
}
