Skip to content

Commit aa4ca3c

Browse files
committed
Document RangeCursor.goto
1 parent 32c46fa commit aa4ca3c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/rangeset.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,19 @@ class Chunk<T extends RangeValue> {
164164
/// only after reading the first range (if any).
165165
export interface RangeCursor<T> {
166166
/// Move the iterator forward.
167-
next: () => void
167+
next(): void
168+
/// Jump the cursor to the given position.
169+
goto(pos: number): void
168170
/// The next range's value. Holds `null` when the cursor has reached
169171
/// its end.
170172
value: T | null
171173
/// The next range's start position.
172174
from: number
173175
/// The next end position.
174176
to: number
177+
/// The position of the set that this range comes from in the array
178+
/// of sets being iterated over.
179+
rank: number
175180
}
176181

177182
type RangeSetUpdate<T extends RangeValue> = {

0 commit comments

Comments
 (0)