IntervalIndex Interface

Packages > fluid-framework > IntervalIndex

Collection of intervals.

Implementers of this interface will typically implement additional APIs to support efficiently querying a collection of intervals in some manner, for example: - “find all intervals with start endpoint between these two points” - “find all intervals which overlap this range” etc.

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 IntervalIndex<TInterval extends ISerializableInterval>

Type Parameters

Parameter Constraint Description
TInterval ISerializableInterval

Methods

Method Alerts Return Type Description
add(interval) Alpha void Adds an interval to the index.
remove(interval) Alpha void Removes an interval from the index.

Method Details

add

Adds an interval to the index.

This API is provided as an alpha preview and may change without notice.

To use, import via fluid-framework/alpha.

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

Signature

add(interval: TInterval): void;

Remarks

Application code should never need to invoke this method on their index for production scenarios: Fluid handles adding and removing intervals from an index in response to sequence or interval changes.

Parameters

Parameter Type Description
interval TInterval

remove

Removes an interval from the index.

This API is provided as an alpha preview and may change without notice.

To use, import via fluid-framework/alpha.

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

Signature

remove(interval: TInterval): void;

Remarks

Application code should never need to invoke this method on their index for production scenarios: Fluid handles adding and removing intervals from an index in response to sequence or interval changes.

Parameters

Parameter Type Description
interval TInterval