/**
 * Tracks the user's current selection, and exposes it to the subtree using the
 * function-as-children pattern.
 */
import * as React from "react";
import type { DOMHighlight, DOMRange } from "./types";
export type TrackedSelection = {
    focusNode: Node;
    focusOffset: number;
    proposedHighlight: DOMHighlight;
};
type Props = {
    buildHighlight: (domRange: DOMRange) => DOMHighlight | null | undefined;
    children?: (trackedSelection: TrackedSelection | null | undefined, userIsMouseSelecting: boolean) => React.ReactElement<any>;
    enabled: boolean;
};
type State = {
    mouseState: "down" | "down-and-selecting" | "up";
    trackedSelection: TrackedSelection | null | undefined;
};
declare class SelectionTracker extends React.PureComponent<Props, State> {
    state: State;
    componentDidMount(): void;
    componentDidUpdate(prevProps: Props): void;
    componentWillUnmount(): void;
    _updateListeners(wasListening: boolean, willListen: boolean): void;
    /**
     * Get the current selection focus and range, if present and non-collapsed.
     *
     * Otherwise, if there is no current selection or it's collapsed, return
     * null.
     */
    _computeFocusAndRange(): {
        focusNode: Node;
        focusOffset: number;
        range: DOMRange;
    } | null | undefined;
    /**
     * Compute and update the TrackedSelection to reflect the document state.
     */
    _updateTrackedSelection(): void;
    _handleSelectionChange: () => void;
    _handleMouseDown: () => void;
    _handleMouseUp: () => void;
    render(): null | React.ReactElement<React.ComponentProps<"div">>;
}
export default SelectionTracker;
