import { MaybeRefOrGetter, Ref } from 'vue'; import { SelectionPayload } from './types'; export interface ResolveSelectionInput { text: string; ranges: Range[]; /** Only report selections contained by this element. */ root?: Element | null; /** Selections shorter than this are ignored. */ minLength: number; } /** * The whole decision in one pure function: what counts as a selection worth * anchoring to, and what the bar gets handed. Exported so the rules can be * tested without standing up a live `Selection`. */ export declare function resolveSelectionPayload(input: ResolveSelectionInput): SelectionPayload | null; export interface UseSelectionAnchorOptions { /** Confine tracking to one subtree. Omit to watch the whole document. */ root?: MaybeRefOrGetter; /** * Settle time for the `selectionchange` stream, in ms. Dragging a selection * fires it on every frame. @default 120 */ debounce?: number; /** Minimum trimmed length worth acting on. @default 1 */ minLength?: number; /** Stop reporting without unmounting. */ disabled?: MaybeRefOrGetter; /** * Elements whose focus must not count as a deselection — normally the bar * itself. Focusing its text field collapses the selection, and without this * the bar would retract the instant someone started typing into it. */ ignore?: MaybeRefOrGetter>; } export interface UseSelectionAnchorReturn { selection: Ref; /** Drop the snapshot — call it once the rewrite has been applied or dropped. */ clear: () => void; } export declare function useSelectionAnchor(options?: UseSelectionAnchorOptions): UseSelectionAnchorReturn;