(container: Element)
| 624 | } |
| 625 | |
| 626 | export function getSelection(container: Element): [Position, Position] | null { |
| 627 | let selection = window.getSelection(); |
| 628 | if (!selection || selection.rangeCount === 0) { |
| 629 | return null; |
| 630 | } |
| 631 | let range = selection.getRangeAt(0); |
| 632 | return rangeToPositions(container, range); |
| 633 | } |
| 634 | |
| 635 | export function getSelectedRange(container: Element) { |
| 636 | let selection = window.getSelection(); |
no test coverage detected