diff --git a/types/rangy/index.d.ts b/types/rangy/index.d.ts index b6615b9aad..4a3afc08a1 100644 --- a/types/rangy/index.d.ts +++ b/types/rangy/index.d.ts @@ -31,6 +31,7 @@ interface RangyRange extends Range { equals(range:RangyRange):boolean; refresh():any; select():any; + toCharacterRange(containerNode:Node):{start:number, end:number}; } interface RangySelection extends Selection { diff --git a/types/rangy/rangy-tests.ts b/types/rangy/rangy-tests.ts index de2ec468f0..3b177a46b3 100644 --- a/types/rangy/rangy-tests.ts +++ b/types/rangy/rangy-tests.ts @@ -74,6 +74,7 @@ function testRangyRange() { rangyRange.splitBoundaries(); assertString(rangyRange.toHtml()); assertRangyRange(rangyRange.union(rangyRange)); + let characterRange:{start:number, end:number} = rangyRange.toCharacterRange(new Node); } function testSelection() {