/** * Copyright (c) 2017-2019 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal */ import { Interval } from './interval.js'; declare namespace SortedArray { const Empty: SortedArray; const ofUnsortedArray: (xs: ArrayLike) => SortedArray; const ofSingleton: (v: number) => SortedArray; const ofSortedArray: (xs: ArrayLike) => SortedArray; /** create sorted array [min, max] (it DOES contain the max value) */ const ofRange: (min: T, max: T) => SortedArray; /** create sorted array [min, max) (it does NOT contain the max value) */ const ofBounds: (min: T, max: T) => SortedArray; const is: (v: any) => v is SortedArray; const isRange: (array: ArrayLike) => boolean; const has: (array: SortedArray, x: T) => boolean; /** Returns the index of `x` in `set` or -1 if not found. */ const indexOf: (array: SortedArray, x: T) => number; const indexOfInInterval: (array: SortedArray, x: number, bounds: Interval) => number; const indexOfInRange: (array: SortedArray, x: number, start: number, end: number) => number; /** Returns `array[0]` */ const start: (array: SortedArray) => T; /** Returns `array[array.length - 1] + 1` */ const end: (array: SortedArray) => T; const min: (array: SortedArray) => T; const max: (array: SortedArray) => T; const size: (array: SortedArray) => number; const hashCode: (array: SortedArray) => number; const toString: (array: SortedArray) => string; const areEqual: (a: SortedArray, b: SortedArray) => boolean; const areIntersecting: (a: SortedArray, b: SortedArray) => boolean; const isSubset: (a: SortedArray, b: SortedArray) => boolean; const union: (a: SortedArray, b: SortedArray) => SortedArray; const intersect: (a: SortedArray, b: SortedArray) => SortedArray; const subtract: (a: SortedArray, b: SortedArray) => SortedArray; const findPredecessorIndex: (array: SortedArray, x: T) => number; const findPredecessorIndexInInterval: (array: SortedArray, x: T, bounds: Interval) => number; const findRange: (array: SortedArray, min: T, max: T) => Interval; const intersectionSize: (a: SortedArray, b: SortedArray) => number; const deduplicate: (array: SortedArray) => SortedArray; /** Returns indices of xs in the array. E.g. indicesOf([10, 11, 12], [10, 12]) ==> [0, 2] */ const indicesOf: (array: SortedArray, xs: SortedArray) => SortedArray; } interface SortedArray extends ArrayLike { '@type': 'int-sorted-array'; } export { SortedArray };