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

Constructor Alerts Description
(constructor)(refType, props) Beta Constructs a new instance of the Marker class

Static Properties

Property Alerts Modifiers Type Description
type Beta readonly

Static Methods

Method Alerts Return Type Description
fromJSONObject(spec) Beta Marker | undefined
is(segment) Beta segment is Marker
make(refType, props) Beta Marker

Properties

Property Alerts Modifiers Type Description
refType Beta ReferenceType
type Beta readonly

Methods

Method Alerts Return Type Description
append() Beta void
canAppend(segment) Beta boolean
clone() Beta Marker
createSplitSegmentAt(pos) Beta undefined
getId() Beta string | undefined
getOffset() Beta number
getProperties() Beta PropertySet | undefined
getSegment() Beta Marker
toJSONObject() Beta IJSONMarkerSegment
toString() Beta string

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

Parameter Modifiers Type Description
refType ReferenceType
props optional PropertySet

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

Parameter Type Description
segment ISegment

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

Parameter Type Description
pos number

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

Parameter Type Description
spec IJSONSegment

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

Parameter Type Description
segment ISegment

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

Parameter Modifiers Type Description
refType ReferenceType
props optional PropertySet

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