SequenceInterval Class

Packages > fluid-framework > SequenceInterval

Interval implementation whose ends are associated with positions in a mutatable sequence. As such, when content is inserted into the middle of the interval, the interval expands to include that content.

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 declare class SequenceInterval implements ISerializableInterval

Implements: ISerializableInterval

Remarks

The endpoints’ positions should be treated exclusively to get reasonable behavior. E.g., an interval referring to “hello” in “hello world” should have a start position of 0 and an end position of 5.

To see why, consider what happens if “llo wor” is removed from the string to make “held”. The interval’s startpoint remains on the “h” (it isn’t altered), but the interval’s endpoint slides forward to the next unremoved position, which is the “l” in “held”. Users would generally expect the interval to now refer to “he” (as it is the subset of content remaining after the removal), hence the “l” should be excluded. If the interval endpoint was treated inclusively, the interval would now refer to “hel”, which is undesirable.

Since the endpoints of an interval are treated exclusively but cannot be greater than or equal to the length of the associated sequence, there exist special endpoint segments, “start” and “end”, which represent the position immediately before or immediately after the string respectively.

If a SequenceInterval is created on a sequence with the mergeTreeReferencesCanSlideToEndpoint feature flag set to true, the endpoints of the interval that are exclusive will have the ability to slide to these special endpoint segments.

Constructors

Constructor Alerts Description
(constructor)(client, start, end, intervalType, props, startSide, endSide) Deprecated, Alpha Constructs a new instance of the SequenceInterval class

Properties

Property Alerts Modifiers Type Description
end Alpha LocalReferencePosition End endpoint of this interval.
endSide Alpha readonly Side
intervalType Alpha IntervalType
properties Alpha PropertySet Serializable bag of properties associated with the interval.
propertyManager Alpha PropertiesManager
start Alpha LocalReferencePosition Start endpoint of this interval.
startSide Alpha readonly Side
stickiness Alpha readonly IntervalStickiness

Constructor Details

(constructor)

Constructs a new instance of the SequenceInterval class

This API is deprecated and will be removed in a future release.

This functionality was not meant to be exported and will be removed in a future release

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

constructor(client: Client, 
    start: LocalReferencePosition, 
    end: LocalReferencePosition, intervalType: IntervalType, props?: PropertySet, startSide?: Side, endSide?: Side);

Parameters

Parameter Modifiers Type Description
client Client
start LocalReferencePosition
end LocalReferencePosition
intervalType IntervalType
props optional PropertySet
startSide optional Side
endSide optional Side

Property Details

end

End endpoint of this interval.

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

end: LocalReferencePosition;

Type: LocalReferencePosition

Remarks

This endpoint can be resolved into a character position using the SharedString it’s a part of.

endSide

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

readonly endSide: Side;

Type: Side

intervalType

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

intervalType: IntervalType;

Type: IntervalType

properties

Serializable bag of properties associated with the interval.

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

properties: PropertySet;

Type: PropertySet

propertyManager

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

propertyManager: PropertiesManager;

Type: PropertiesManager

start

Start endpoint of this interval.

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

start: LocalReferencePosition;

Type: LocalReferencePosition

Remarks

This endpoint can be resolved into a character position using the SharedString it’s a part of.

startSide

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

readonly startSide: Side;

Type: Side

stickiness

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

get stickiness(): IntervalStickiness;

Type: IntervalStickiness