(s: SelectionState)
| 682 | * Returns null if no active selection. |
| 683 | */ |
| 684 | export function selectionBounds(s: SelectionState): { |
| 685 | start: { col: number; row: number } |
| 686 | end: { col: number; row: number } |
| 687 | } | null { |
| 688 | if (!s.anchor || !s.focus) return null |
| 689 | return comparePoints(s.anchor, s.focus) <= 0 |
| 690 | ? { start: s.anchor, end: s.focus } |
| 691 | : { start: s.focus, end: s.anchor } |
| 692 | } |
| 693 | |
| 694 | /** |
| 695 | * Check if a cell at (col, row) is within the current selection range. |
no test coverage detected