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.
Signature
protected createSplitSegmentAt(pos: number): undefined;
Parameters
| Parameter | Type | Description |
|---|---|---|
| pos | number |
Returns
Return type: undefined
fromJSONObject
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
For more information about our API support guarantees, see here.
Signature
getId(): string | undefined;
Returns
Return type: string | undefined
getOffset
For more information about our API support guarantees, see here.
Signature
getOffset(): number;
Returns
Return type: number
getProperties
For more information about our API support guarantees, see here.
Signature
getProperties(): PropertySet | undefined;
Returns
Return type: PropertySet | undefined
getSegment
For more information about our API support guarantees, see here.
Signature
getSegment(): Marker;
Returns
Return type: Marker
is
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
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
For more information about our API support guarantees, see here.
Signature
toJSONObject(): IJSONMarkerSegment;
Returns
Return type: IJSONMarkerSegment
toString
For more information about our API support guarantees, see here.
Signature
toString(): string;
Returns
Return type: string