BoundIntervalType
Defined in: interval.ts:800
The shape of a domain-bound interval CLASS produced by defineIntervalType:
a new-able constructor plus the static factory methods. The explicit type is
the public return type of defineIntervalType (not the local anonymous class)
so .d.ts generation never has to synthesize an inline type literal for it.
Instances and factory results are typed as the base Interval<T> (still
instanceof Interval and instanceof the bound class at runtime).
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BoundIntervalType(spec?): Interval<T>;Defined in: interval.ts:805
Construct from a IntervalSpec (explicit brackets, omit a side for
unbounded) or wrap an existing Interval. No argument ⇒ (-∞,+∞).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
spec? |
| Interval<T> | IntervalSpec<T> |
Returns
Section titled “Returns”Interval<T>
Properties
Section titled “Properties”| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
domain |
readonly |
IntervalDomain<T> |
The IntervalDomain this class is bound to. | interval.ts:807 |
Methods
Section titled “Methods”all(): Interval<T>;Defined in: interval.ts:827
(-∞, +∞) — the full interval (open infinities).
Returns
Section titled “Returns”Interval<T>
atLeast()
Section titled “atLeast()”atLeast(a): Interval<T>;Defined in: interval.ts:819
[a, +∞) — everything ≥ a.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
a |
T |
Returns
Section titled “Returns”Interval<T>
atMost()
Section titled “atMost()”atMost(b): Interval<T>;Defined in: interval.ts:823
(-∞, b] — everything ≤ b.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
b |
T |
Returns
Section titled “Returns”Interval<T>
closed()
Section titled “closed()”closed(a, b): Interval<T>;Defined in: interval.ts:809
[a, b] — both endpoints included.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
a |
T |
b |
T |
Returns
Section titled “Returns”Interval<T>
closedOpen()
Section titled “closedOpen()”closedOpen(a, b): Interval<T>;Defined in: interval.ts:813
[a, b) — lower included, upper excluded (the canonical half-open form).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
a |
T |
b |
T |
Returns
Section titled “Returns”Interval<T>
empty()
Section titled “empty()”empty(): Interval<T>;Defined in: interval.ts:829
The empty interval ∅ (contains nothing).
Returns
Section titled “Returns”Interval<T>
fromCenter()
Section titled “fromCenter()”fromCenter(center, length): Interval<T>;Defined in: interval.ts:835
[center - length/2, center + length/2) — half-open, needs domain.add.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
center |
T |
length |
number |
Returns
Section titled “Returns”Interval<T>
fromEnd()
Section titled “fromEnd()”fromEnd(end, length): Interval<T>;Defined in: interval.ts:833
[end - length, end) — half-open, needs domain.add.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
end |
T |
length |
number |
Returns
Section titled “Returns”Interval<T>
fromStart()
Section titled “fromStart()”fromStart(start, length): Interval<T>;Defined in: interval.ts:831
[start, start + length) — half-open, needs domain.add.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
start |
T |
length |
number |
Returns
Section titled “Returns”Interval<T>
greaterThan()
Section titled “greaterThan()”greaterThan(a): Interval<T>;Defined in: interval.ts:821
(a, +∞) — everything > a.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
a |
T |
Returns
Section titled “Returns”Interval<T>
lessThan()
Section titled “lessThan()”lessThan(b): Interval<T>;Defined in: interval.ts:825
(-∞, b) — everything < b.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
b |
T |
Returns
Section titled “Returns”Interval<T>
open()
Section titled “open()”open(a, b): Interval<T>;Defined in: interval.ts:811
(a, b) — both endpoints excluded.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
a |
T |
b |
T |
Returns
Section titled “Returns”Interval<T>
openClosed()
Section titled “openClosed()”openClosed(a, b): Interval<T>;Defined in: interval.ts:815
(a, b] — lower excluded, upper included.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
a |
T |
b |
T |
Returns
Section titled “Returns”Interval<T>
parse()
Section titled “parse()”parse(text): Interval<T>;Defined in: interval.ts:837
Parse a string form ("[1,5)", "(-Infinity,5]", "∅") via domain.parse.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text |
string |
Returns
Section titled “Returns”Interval<T>
point()
Section titled “point()”point(value): Interval<T>;Defined in: interval.ts:817
[value, value] — the single-element interval.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
value |
T |
Returns
Section titled “Returns”Interval<T>