import { BoundType } from "../core/bound-type"; import { Comparable } from "../core/comparable"; /** * A range (or "interval") defines the boundaries around a contiguous span of values of comparables. * Note that it is not possible to iterate over these contained values. * * Based off of https://guava.dev/releases/19.0/api/docs/com/google/common/collect/Range.html#intersection(com.google.common.collect.Range) */ export declare class NumberRange { lowerEndpoint: Comparable; lowerBoundType: BoundType; upperEndpoint: Comparable; upperBoundType: BoundType; constructor(lowerEndpoint: Comparable, lowerBoundType: BoundType, upperEndpoint: Comparable, upperBoundType: BoundType); get lowerEndpointValue(): number; get upperEndpointValue(): number; /** * Returns a range that contains all values greater than or equal to lower and strictly less than upper. */ static closedOpen(lower: Comparable, upper: Comparable): NumberRange; /** * Returns a range that contains all values greater than or equal to lower and less than or equal to upper. */ static closed(lower: Comparable, upper: Comparable): NumberRange; /** * Returns a range that contains all values strictly greater than lower and strictly less than upper. */ static open(lower: Comparable, upper: Comparable): NumberRange; /** * Returns a range that contains all values strictly greater than lower and less than or equal to upper. */ static openClosed(lower: Comparable, upper: Comparable): NumberRange; /** * Returns a range that contains every value. */ static all(): NumberRange; /** * Returns a range that contains all values greater than or equal to endpoint. */ static atLeast(endpoint: Comparable): NumberRange; /** * Returns a range that contains all values less than or equal to endpoint. */ static atMost(endpoint: Comparable): NumberRange; /** * Returns a range from the given endpoint, which may be either inclusive (closed) or exclusive (open), with no upper bound. */ static downTo(endpoint: Comparable, boundType: BoundType): NumberRange; /** * Returns a range with no lower bound up to the given endpoint, which may be either inclusive (closed) or exclusive (open). */ static upTo(endpoint: Comparable, boundType: BoundType): NumberRange; /** * Returns true if value is within the bounds of this range. */ contains(comparable: Comparable): boolean; /** * Returns true if the bounds of other do not extend outside the bounds of this range. */ encloses(other: NumberRange): boolean; /** * Returns true if the ranges overlap in any way */ overlaps(other: NumberRange): boolean; /** * Returns the maximal range enclosed by both this range and connectedRange, if such a range exists. */ intersection(other: NumberRange): NumberRange | null; /** * Returns true if there exists a (possibly empty) range which is enclosed by both this range and other. */ isConnected(other: NumberRange): boolean; /** * Returns true if this range is of the form [v..v) or (v..v]. */ isEmpty(): boolean; /** * Returns the minimal range that encloses both this range and other. */ span(other: NumberRange): NumberRange; /** * Returns a string representation of this range, such as "[3..5)". See tests, class docs or guava RangeMap docs for more examples. */ toString(): string; } //# sourceMappingURL=number-range.d.ts.map