Skip to main content

Marker Class

Markers are a special kind of segment that do not hold any content.

Markers with a reference type of Tile support spatially accelerated queries for finding the next marker to the left or right of it in sub-linear time. This is useful, for example, in the case of jumping from the start of a paragraph to the end, assuming a paragraph is bound by markers at the start and end.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/merge-tree/legacy.

For more information about our API support guarantees, see here.

Signature

export declare class Marker extends BaseSegment implements ReferencePosition, ISegment

Extends: BaseSegment

Implements: ReferencePosition, ISegment

Constructors

ConstructorAlertsDescription
(constructor)(refType, props)BetaConstructs a new instance of the Marker class

Static Properties

PropertyAlertsModifiersTypeDescription
typeBetareadonly

Static Methods

MethodAlertsReturn TypeDescription
fromJSONObject(spec)BetaMarker | undefined
is(segment)Betasegment is Marker
make(refType, props)BetaMarker

Properties

PropertyAlertsModifiersTypeDescription
refTypeBetaReferenceType
typeBetareadonly

Methods

MethodAlertsReturn TypeDescription
append()Betavoid
canAppend(segment)Betaboolean
clone()BetaMarker
createSplitSegmentAt(pos)Betaundefined
getId()Betastring | undefined
getOffset()Betanumber
getProperties()BetaPropertySet | undefined
getSegment()BetaMarker
toJSONObject()BetaIJSONMarkerSegment
toString()Betastring

Constructor Details

(constructor)

Constructs a new instance of the Marker class

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

constructor(refType: ReferenceType, props?: PropertySet);

Parameters

ParameterModifiersTypeDescription
refTypeReferenceType
propsoptionalPropertySet

Property Details

refType

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

refType: ReferenceType;

Type: ReferenceType

type

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

readonly type = "Marker";

type

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

static readonly type = "Marker";

Method Details

append

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

append(): void;

canAppend

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

canAppend(segment: ISegment): boolean;

Parameters

ParameterTypeDescription
segmentISegment

Returns

Return type: boolean

clone

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

clone(): Marker;

Returns

Return type: Marker

createSplitSegmentAt

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

protected createSplitSegmentAt(pos: number): undefined;

Parameters

ParameterTypeDescription
posnumber

Returns

Return type: undefined

fromJSONObject

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

static fromJSONObject(spec: IJSONSegment): Marker | undefined;

Parameters

ParameterTypeDescription
specIJSONSegment

Returns

Return type: Marker | undefined

getId

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

getId(): string | undefined;

Returns

Return type: string | undefined

getOffset

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

getOffset(): number;

Returns

Return type: number

getProperties

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

getProperties(): PropertySet | undefined;

Returns

Return type: PropertySet | undefined

getSegment

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

getSegment(): Marker;

Returns

Return type: Marker

is

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

static is(segment: ISegment): segment is Marker;

Parameters

ParameterTypeDescription
segmentISegment

Returns

Return type: segment is Marker

make

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

static make(refType: ReferenceType, props?: PropertySet): Marker;

Parameters

ParameterModifiersTypeDescription
refTypeReferenceType
propsoptionalPropertySet

Returns

Return type: Marker

toJSONObject

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

toJSONObject(): IJSONMarkerSegment;

Returns

Return type: IJSONMarkerSegment

toString

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

toString(): string;

Returns

Return type: string