/** * Whether a press must be swallowed because the same gesture SELECTED text. * * A register row is a button wrapped around DATA. Dragging across a customer's * name ends in a click on the row, so without this guard the release navigates * to the record and discards the selection — the row's own press is what makes * its content uncopyable. Both of a row's press surfaces consult this: * `PressableRow` (the mouse) and `RowFocusEntry` (the blank space beneath the cells). * * Deliberately narrow. A plain click that got swallowed would leave the row * impossible to open, which is far worse than losing a selection, so only a * real, non-empty selection suppresses — and only a POINTER gesture consults it * on the door, which is the KEYBOARD target: a selection left anywhere on the * page survives a Tab, so a door that checked it on Enter would refuse to open * any row until the user cleared a selection they may not even see. */ /** The shape read off `window.getSelection()`. Structural, so this module stays * DOM-free at the type level and is testable without a document. */ export interface TextSelection { isCollapsed: boolean; toString(): string; } /** * True when `selection` holds text the user meant to keep. A COLLAPSED selection * is a caret, not a selection. Whitespace-only is what an ordinary click can * leave behind when its anchor and focus land in different inline boxes — a row * that refused to open after a stray click would be a worse bug than the one * this fixes, so that reads as "nothing selected" too. */ export declare function isTextSelected(selection: TextSelection | null | undefined): boolean; /** The live selection, or null where `window.getSelection` is unavailable (a * prerender pass), so no press is suppressed there. */ export declare function activeTextSelection(): TextSelection | null; /** The guard itself: did the gesture that just ended select text? */ export declare function pressSelectedText(): boolean;