import { OpaqueObject } from '@legendapp/state'; import { DeepMaybeObservable, MaybeObservable, ReadonlyObservable } from '@usels/core'; import { ConfigurableWindow } from '../../shared/configurable.mjs'; interface UseTextSelectionOptions extends ConfigurableWindow { /** Throttle selectionchange handler in ms. Mutually exclusive with debounce. */ throttle?: MaybeObservable; /** Debounce selectionchange handler in ms. Mutually exclusive with throttle. */ debounce?: MaybeObservable; } interface UseTextSelectionReturn { /** Selected text content */ text$: ReadonlyObservable; /** Bounding rectangles of selected ranges */ rects$: ReadonlyObservable; /** Selection ranges */ ranges$: ReadonlyObservable; /** Current Selection object */ selection$: ReadonlyObservable | null>; } /** * Framework-agnostic reactive text-selection tracker. Listens to * `selectionchange` on the document and exposes the current selection's text, * ranges, rects (lazily computed), and raw `Selection` object. */ declare function createTextSelection(options?: DeepMaybeObservable): UseTextSelectionReturn; export { type UseTextSelectionOptions, type UseTextSelectionReturn, createTextSelection };