(node: Node)
| 614 | } |
| 615 | |
| 616 | function indexOfNode(node: Node) { |
| 617 | let index = 0; |
| 618 | let n: Node | null = node; |
| 619 | |
| 620 | while ((n = n.previousSibling)) { |
| 621 | index++; |
| 622 | } |
| 623 | return index; |
| 624 | } |
| 625 | |
| 626 | export function getSelection(container: Element): [Position, Position] | null { |
| 627 | let selection = window.getSelection(); |