Skip to main content
Version: v1

BaseSegment Class

Signature

export declare abstract class BaseSegment extends MergeNode implements ISegment

Extends: MergeNode

Implements: ISegment

Properties

Property Modifiers Type Description
clientId number
localRefs optional LocalReferenceCollection
localRemovedSeq optional number
localSeq optional number
properties optional PropertySet
propertyManager optional PropertiesManager
removedClientIds optional number[]
removedSeq optional number
segmentGroups SegmentGroupCollection
seq number
trackingCollection TrackingGroupCollection
type string

Methods

Method Return Type Description
ack(segmentGroup, opArgs, mergeTree) boolean
addProperties(newProps, op, seq, collabWindow) PropertySet | undefined
addSerializedProps(jseg) void
append(segment) void
canAppend(segment) boolean
clone() ISegment
cloneInto(b) void
createSplitSegmentAt(pos) BaseSegment | undefined
hasProperty(key) boolean
isLeaf() boolean
splitAt(pos) ISegment | undefined
toJSONObject() any

Property Details

clientId

Signature

clientId: number;

Type: number

localRefs

Signature

localRefs?: LocalReferenceCollection;

Type: LocalReferenceCollection

localRemovedSeq

Signature

localRemovedSeq?: number;

Type: number

localSeq

Signature

localSeq?: number;

Type: number

properties

Signature

properties?: PropertySet;

Type: PropertySet

propertyManager

Signature

propertyManager?: PropertiesManager;

Type: PropertiesManager

removedClientIds

Signature

removedClientIds?: number[];

Type: number[]

removedSeq

Signature

removedSeq?: number;

Type: number

segmentGroups

Signature

readonly segmentGroups: SegmentGroupCollection;

Type: SegmentGroupCollection

seq

Signature

seq: number;

Type: number

trackingCollection

Signature

readonly trackingCollection: TrackingGroupCollection;

Type: TrackingGroupCollection

type

Signature

abstract readonly type: string;

Type: string

Method Details

ack

Signature

ack(segmentGroup: SegmentGroup, opArgs: IMergeTreeDeltaOpArgs, mergeTree: MergeTree): boolean;

Parameters

Parameter Type Description
segmentGroup SegmentGroup
opArgs IMergeTreeDeltaOpArgs
mergeTree MergeTree

Returns

Return type: boolean

addProperties

Signature

addProperties(newProps: PropertySet, op?: ICombiningOp, seq?: number, collabWindow?: CollaborationWindow): PropertySet | undefined;

Parameters

Parameter Modifiers Type Description
newProps PropertySet
op optional ICombiningOp
seq optional number
collabWindow optional CollaborationWindow

Returns

Return type: PropertySet | undefined

addSerializedProps

Signature

protected addSerializedProps(jseg: IJSONSegment): void;

Parameters

Parameter Type Description
jseg IJSONSegment

append

Signature

abstract append(segment: ISegment): void;

Parameters

Parameter Type Description
segment ISegment

canAppend

Signature

canAppend(segment: ISegment): boolean;

Parameters

Parameter Type Description
segment ISegment

Returns

Return type: boolean

clone

Signature

abstract clone(): ISegment;

Returns

Return type: ISegment

cloneInto

Signature

protected cloneInto(b: ISegment): void;

Parameters

Parameter Type Description
b ISegment

createSplitSegmentAt

Signature

protected abstract createSplitSegmentAt(pos: number): BaseSegment | undefined;

Parameters

Parameter Type Description
pos number

Returns

Return type: BaseSegment | undefined

hasProperty

Signature

hasProperty(key: string): boolean;

Parameters

Parameter Type Description
key string

Returns

Return type: boolean

isLeaf

Signature

isLeaf(): boolean;

Returns

Return type: boolean

splitAt

Signature

splitAt(pos: number): ISegment | undefined;

Parameters

Parameter Type Description
pos number

Returns

Return type: ISegment | undefined

toJSONObject

Signature

abstract toJSONObject(): any;

Returns

Return type: any