Skip to main content

IInterval Interface

Basic interval abstraction

This API is provided for existing users, but is not recommended for new users.

To use, import via fluid-framework/legacy.

For more information about our API support guarantees, see here.

Signature

export interface IInterval

Methods

MethodAlertsReturn TypeDescription
compare(b)BetanumberCompares this interval to b with standard comparator semantics: - returns -1 if this is less than b - returns 1 if this is greater than b - returns 0 if this is equivalent to b
compareEnd(b)BetanumberCompares the end endpoint of this interval to b's end endpoint. Standard comparator semantics apply.
compareStart(b)BetanumberCompares the start endpoint of this interval to b's start endpoint. Standard comparator semantics apply.
overlaps(b)Betaboolean

Method Details

compare

Compares this interval to b with standard comparator semantics: - returns -1 if this is less than b - returns 1 if this is greater than b - returns 0 if this is equivalent to b

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

compare(b: IInterval): number;

Parameters

ParameterTypeDescription
bIIntervalInterval to compare against

Returns

Return type: number

compareEnd

Compares the end endpoint of this interval to b's end endpoint. Standard comparator semantics apply.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

compareEnd(b: IInterval): number;

Parameters

ParameterTypeDescription
bIIntervalInterval to compare against

Returns

Return type: number

compareStart

Compares the start endpoint of this interval to b's start endpoint. Standard comparator semantics apply.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

compareStart(b: IInterval): number;

Parameters

ParameterTypeDescription
bIIntervalInterval to compare against

Returns

Return type: number

overlaps

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

overlaps(b: IInterval): boolean;

Parameters

ParameterTypeDescription
bIInterval

Returns

whether this interval overlaps with b. Intervals are considered to overlap if their intersection is non-empty.

Return type: boolean