range-tree.d.ts 726 B

123456789101112131415161718192021222324
  1. import { RangeCov } from "./types";
  2. export declare class RangeTree {
  3. start: number;
  4. end: number;
  5. delta: number;
  6. children: RangeTree[];
  7. constructor(start: number, end: number, delta: number, children: RangeTree[]);
  8. /**
  9. * @precodition `ranges` are well-formed and pre-order sorted
  10. */
  11. static fromSortedRanges(ranges: ReadonlyArray<RangeCov>): RangeTree | undefined;
  12. normalize(): void;
  13. /**
  14. * @precondition `tree.start < value && value < tree.end`
  15. * @return RangeTree Right part
  16. */
  17. split(value: number): RangeTree;
  18. /**
  19. * Get the range coverages corresponding to the tree.
  20. *
  21. * The ranges are pre-order sorted.
  22. */
  23. toRanges(): RangeCov[];
  24. }