(node: Node)
| 563 | }); |
| 564 | |
| 565 | function indexOfNode(node: Node) { |
| 566 | let index = 0; |
| 567 | let n: Node | null = node; |
| 568 | |
| 569 | while ((n = n.previousSibling)) { |
| 570 | index++; |
| 571 | } |
| 572 | return index; |
| 573 | } |
| 574 | |
| 575 | export function getSelection(container: Element): [Position, Position] | null { |
| 576 | let selection = window.getSelection(); |