ISharedString Interface
Fluid object interface describing access methods on a SharedString
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 ISharedString extends ISharedSegmentSequence<SharedStringSegment>
Extends: ISharedSegmentSequence<SharedStringSegment>
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| annotateMarker(marker, props) | Beta | void | Annotates the marker with the provided properties. |
| getMarkerFromId(id) | Beta | ISegment | undefined | Looks up and returns a Marker using its id. Returns undefined if there is no marker with the provided id in this SharedString. |
| getText(start, end) | Beta | string | Retrieve text from the SharedString in string format. |
| getTextRangeWithMarkers(start, end) | Beta | string | |
| getTextWithPlaceholders(start, end) | Beta | string | Adds spaces for markers and handles, so that position calculations account for them. |
| insertMarker(pos, refType, props) | Beta | void | Inserts a marker at the position. |
| insertMarkerRelative(relativePos1, refType, props) | Beta | void | Inserts a marker at a relative position. |
| insertText(pos, text, props) | Beta | void | Inserts the text at the position. |
| insertTextRelative(relativePos1, text, props) | Beta | void | Inserts the text at the position. |
| removeText(start, end) | Beta | void | Removes the text in the given range. |
| replaceText(start, end, text, props) | Beta | void | Replaces a range with the provided text. |
| searchForMarker(startPos, markerLabel, forwards) | Beta | Marker | undefined | Searches a string for the nearest marker in either direction to a given start position. The search will include the start position, so markers at the start position are valid results of the search. |
Method Details
annotateMarker
Annotates the marker with the provided properties.
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
annotateMarker(marker: Marker, props: PropertySet): void;
Parameters
| Parameter | Type | Description |
|---|---|---|
| marker | Marker | The marker to annotate |
| props | PropertySet | The properties to annotate the marker with |
getMarkerFromId
Looks up and returns a Marker using its id. Returns undefined if there is no marker with the provided id in this SharedString.
This API is provided for existing users, but is not recommended for new users.
For more information about our API support guarantees, see here.