import type { RefObject } from "react";
export interface UseTextareaSelectionOptions {
    textareaRef: RefObject<HTMLTextAreaElement | null>;
    /** Current textarea value. */
    value: string;
    /** Setter — called when `cut`/`wrap`/`replace` mutate the text. */
    onChange: (next: string) => void;
}
export interface UseTextareaSelectionReturn {
    /** True when there's a non-empty selection in the focused textarea. */
    active: boolean;
    /** Selected text. Empty string when `active` is false. */
    text: string;
    /** Character offsets. */
    start: number;
    end: number;
    /** Approximate pixel rect of the selection — anchor a floating
     *  toolbar above this (`top - toolbar.height - 4`). Null when no
     *  active selection. */
    rect: DOMRect | null;
    /** Copy the current selection to the clipboard. Resolves with `true`
     *  on success. */
    copy: () => Promise<boolean>;
    /** Copy + delete (= cut). Resolves `true` on success. */
    cut: () => Promise<boolean>;
    /** Wrap the selection with `open` / `close` strings. Selection
     *  expands to include the wrappers. */
    wrap: (open: string, close?: string) => void;
    /** Replace the selection with a literal string. Caret lands at the
     *  end of the inserted text. */
    replace: (text: string) => void;
}
export declare function useTextareaSelection({ textareaRef, value, onChange, }: UseTextareaSelectionOptions): UseTextareaSelectionReturn;
//# sourceMappingURL=useTextareaSelection.d.ts.map