ISharedString Interface
Fluid object interface describing access methods on a SharedString
Signature
export interface ISharedString extends SharedSegmentSequence<SharedStringSegment>
Extends: SharedSegmentSequence<SharedStringSegment
Methods
| Method | Return Type | Description |
|---|---|---|
| insertMarker(pos, refType, props) | IMergeTreeInsertMsg | Inserts a marker at the position. |
| insertText(pos, text, props) | void | Inserts the text at the position. |
| posFromRelativePos(relativePos) | number | Given a position specified relative to a marker id, lookup the marker and convert the position to a character position. |
Method Details
insertMarker
Inserts a marker at the position.
Signature
insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): IMergeTreeInsertMsg;
Parameters
| Parameter | Modifiers | Type | Description |
|---|---|---|---|
| pos | number | The position to insert the marker at | |
| refType | ReferenceType | The reference type of the marker | |
| props | optional | PropertySet | The properties of the marker |
Returns
Return type: IMergeTreeInsertMsg
insertText
Inserts the text at the position.
Signature
insertText(pos: number, text: string, props?: PropertySet): void;
Parameters
| Parameter | Modifiers | Type | Description |
|---|---|---|---|
| pos | number | The position to insert the text at | |
| text | string | The text to insert | |
| props | optional | PropertySet | The properties of the text |
posFromRelativePos
Given a position specified relative to a marker id, lookup the marker and convert the position to a character position.
Signature
posFromRelativePos(relativePos: IRelativePosition): number;
Parameters
| Parameter | Type | Description |
|---|---|---|
| relativePos | IRelativePosition | Id of marker (may be indirect) and whether position is before or after marker. |
Returns
Return type: number