(node: Node)
| 595 | } |
| 596 | |
| 597 | function indexOfNode(node: Node) { |
| 598 | let index = 0; |
| 599 | let n: Node | null = node; |
| 600 | |
| 601 | while ((n = n.previousSibling)) { |
| 602 | index++; |
| 603 | } |
| 604 | return index; |
| 605 | } |
| 606 | |
| 607 | export function getSelection(container: Element): [Position, Position] | null { |
| 608 | let selection = window.getSelection(); |