Skip to content

ScheduleInterval

15 exports Added in v2.0.0 Source

Constructors

after

Added in v2.0.0 Source

Construct an Interval that includes all time equal to and after the specified start time.

Signature

declare const after: (startMilliseconds: number) => Interval;

before

Added in v2.0.0 Source

Construct an Interval that includes all time equal to and before the specified end time.

Signature

declare const before: (endMilliseconds: number) => Interval;

empty

Added in v2.0.0 Source

An Interval of zero-width.

Signature

declare const empty: Interval;

make

Added in v2.0.0 Source

Constructs a new interval from the two specified endpoints. If the start endpoint greater than the end endpoint, then a zero size interval will be returned.

Signature

declare const make: (startMillis: number, endMillis: number) => Interval;

Getters

size

Added in v2.0.0 Source

Calculates the size of the Interval as the Duration from the start of the interval to the end of the interval.

Signature

declare const size: (self: Interval) => Duration.Duration;

Models

Interval interface

Added in v2.0.0 Source

An Interval represents an interval of time. Intervals can encompass all time, or no time at all.

Signature

interface Interval {
  readonly [IntervalTypeId]: typeof IntervalTypeId;
  readonly endMillis: number;
  readonly startMillis: number;
}

Ordering

intersect

Added in v2.0.0 Source

Computes a new Interval which is the intersection of this Interval and that Interval.

Signature

declare const intersect: {
  (that: Interval): (self: Interval) => Interval;
  (self: Interval, that: Interval): Interval;
};

isEmpty

Added in v2.0.0 Source

Returns true if the specified Interval is empty, false otherwise.

Signature

declare const isEmpty: (self: Interval) => boolean;

isNonEmpty

Added in v2.0.0 Source

Returns true if the specified Interval is non-empty, false otherwise.

Signature

declare const isNonEmpty: (self: Interval) => boolean;

lessThan

Added in v2.0.0 Source

Returns true if this Interval is less than that interval, false otherwise.

Signature

declare const lessThan: {
  (that: Interval): (self: Interval) => boolean;
  (self: Interval, that: Interval): boolean;
};

max

Added in v2.0.0 Source

Returns the maximum of two Intervals.

Signature

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

min

Added in v2.0.0 Source

Returns the minimum of two Intervals.

Signature

declare const min: {
  (that: Interval): (self: Interval) => Interval;
  (self: Interval, that: Interval): Interval;
};

Symbols

Signature

declare const IntervalTypeId: unique symbol;

IntervalTypeId type

Added in v2.0.0 Source

Signature

type IntervalTypeId = typeof IntervalTypeId;

Utils

union

Added in v2.0.0 Source

Computes a new Interval which is the union of this Interval and that Interval as a Some, otherwise returns None if the two intervals cannot form a union.

Signature

declare const union: {
  (that: Interval): (self: Interval) => Option<Interval>;
  (self: Interval, that: Interval): Option<Interval>;
};