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.
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
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
For more information about our API support guarantees, see here.
Signature
refType: ReferenceType;
Type: ReferenceType
type
For more information about our API support guarantees, see here.
Signature
readonly type = "Marker";
type
For more information about our API support guarantees, see here.
Signature
static readonly type = "Marker";
Method Details
append
For more information about our API support guarantees, see here.
Signature
append(): void;
canAppend
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
For more information about our API support guarantees, see here.
Signature
clone(): Marker;
Returns
Return type: Marker
createSplitSegmentAt
For more information about our API support guarantees, see here.