SequencePlace TypeAlias
Defines a position and side relative to a character in a sequence.
For this purpose, sequences look like:
{start} - {character 0} - {character 1} - ... - {character N} - {end}
Each {value}
in the diagram is a character within a sequence. Each -
in the above diagram is a position where text could be inserted. Each position between a {value}
and a -
is a SequencePlace
.
The special endpoints {start}
and {end}
refer to positions outside the contents of the string.
This gives us 2N + 2 possible positions to refer to within a string, where N is the number of characters.
If the position is specified with a bare number, the side defaults to Side.Before
.
If a SequencePlace is the endpoint of a range (e.g. start/end of an interval or search range), the Side value means it is exclusive if it is nearer to the other position and inclusive if it is farther. E.g. the start of a range with Side.After is exclusive of the character at the position.
To use, import via @fluidframework/merge-tree/legacy
.
For more information about our API support guarantees, see here.
Signature
export type SequencePlace = number | "start" | "end" | InteriorSequencePlace;