Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

ScheduleIntervals

13 exports Since v2.0.0 Source

Constructors

Since v2.0.0

Constructs an empty list of Intervals.

Signature

declare const empty: Intervals

Creates Intervals from the specified Iterable<Interval>.

Signature

declare const fromIterable: (intervals: Iterable<Interval.Interval>) => Intervals
Since v2.0.0

Creates a new Intervals from a List of Intervals.

Signature

declare const make: (intervals: Check.Chunk<Interval.Interval>) => Intervals

Getters

Since v2.0.0

The end of the latest interval in the specified Intervals.

Signature

declare const end: (self: Intervals) => number

Returns true if this Intervals is non-empty, false otherwise.

Signature

declare const isNonEmpty: (self: Intervals) => boolean
Since v2.0.0

The start of the earliest interval in the specified Intervals.

Signature

declare const start: (self: Intervals) => number

Models

Intervals

interface
Since v2.0.0

An Intervals represents a list of several Intervals.

Signature

interface Intervals {
readonly [IntervalsTypeId]: typeof IntervalsTypeId;
readonly intervals: Chunk<Interval>;
}

Ordering

Since v2.0.0

Returns true if the start of this Intervals is before the start of that Intervals, false otherwise.

Signature

declare const lessThan: {
(that: Intervals): (self: Intervals) => boolean;
(self: Intervals, that: Intervals): boolean;
}
Since v2.0.0

Returns the maximum of the two Intervals (i.e. which has the latest start).

Signature

declare const max: {
(that: Intervals): (self: Intervals) => Intervals;
(self: Intervals, that: Intervals): Intervals;
}

Symbols

Signature

declare const IntervalsTypeId: unique symbol
Since v2.0.0

Signature

type IntervalsTypeId = typeof IntervalsTypeId

Utils

Produces the intersection of this Intervals and that Intervals.

Signature

declare const intersect: {
(that: Intervals): (self: Intervals) => Intervals;
(self: Intervals, that: Intervals): Intervals;
}
Since v2.0.0

Computes the union of this Intervals and that Intervals

Signature

declare const union: {
(that: Intervals): (self: Intervals) => Intervals;
(self: Intervals, that: Intervals): Intervals;
}