@sv-use/core
Version:
A collection of Svelte 5 utilities.
19 lines (18 loc) • 771 B
TypeScript
import { type ConfigurableWindow } from '../__internal__/configurable.js';
import type { AutoCleanup, CleanupFunction } from '../__internal__/types.js';
interface GetTextSelectionOptions extends ConfigurableWindow, AutoCleanup {
}
type GetTextSelectionReturn = {
readonly text: string;
readonly rects: DOMRect[];
readonly ranges: Range[];
current: Selection | null;
cleanup: CleanupFunction;
};
/**
* Gets the range of text selected by the user or the current position of the caret.
* @param options Additional options to customize the behavior.
* @see https://svelte-librarian.github.io/sv-use/docs/core/browser/get-text-selection
*/
export declare function getTextSelection(options?: GetTextSelectionOptions): GetTextSelectionReturn;
export {};