ISharedString Interface

Packages > fluid-framework > ISharedString

Fluid object interface describing access methods on a SharedString

Signature:

export interface ISharedString extends SharedSegmentSequence<SharedStringSegment> 

Extends: SharedSegmentSequenceSharedStringSegment

Methods

List of methods of this class
Method Description
insertMarker(pos, refType, props) Inserts a marker at the position.
insertText(pos, text, props) Inserts the text at the position.
posFromRelativePos(relativePos) Given a position specified relative to a marker id, lookup the marker and convert the position to a character position.

Methods

insertMarker

Inserts a marker at the position.

Signature:

insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): IMergeTreeInsertMsg;

Parameters

List of parameters
Parameter Type Description
pos The position to insert the marker at
refType The reference type of the marker
props The properties of the marker

Returns:

insertText

Inserts the text at the position.

Signature:

insertText(pos: number, text: string, props?: PropertySet): void;

Parameters

List of parameters
Parameter Type Description
pos The position to insert the text at
text The text to insert
props The properties of the text

Returns:

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

List of parameters
Parameter Type Description
relativePos Id of marker (may be indirect) and whether position is before or after marker.

Returns: