textlint-rule-helper
Version:
A helper library for textlint rule.
14 lines (13 loc) • 410 B
TypeScript
/**
* A set of half-open ranges `[start, end)`.
* It keeps the ranges sorted and merged, so that `has(index)` is a binary search.
*
* `has(index)` returns the same result as checking `start <= index && index < end` for each added range.
* @internal
*/
export declare class SortedRanges {
private starts;
private ends;
add(start: number, end: number): void;
has(index: number): boolean;
}