Skip to main content

BaseSegment Class

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 abstract class BaseSegment implements ISegment

Implements: ISegment

Constructors

ConstructorAlertsDescription
(constructor)(properties)BetaConstructs a new instance of the BaseSegment class

Properties

PropertyAlertsModifiersTypeDescription
attributionBetaoptionalIAttributionCollection<AttributionKey>
cachedLengthBetanumber
propertiesBetaoptionalPropertySet
trackingCollectionBetareadonlyTrackingGroupCollection
typeBetareadonlystring

Methods

MethodAlertsReturn TypeDescription
addSerializedProps(jseg)Betavoid
append(other)Betavoid
canAppend(segment)Betaboolean
clone()BetaISegment
cloneInto(b)Betavoid
createSplitSegmentAt(pos)BetaBaseSegment | undefined
hasProperty(key)Betaboolean
isLeaf()Betathis is ISegment
splitAt(pos)BetaISegment | undefined
toJSONObject()Betaany

Constructor Details

(constructor)

Constructs a new instance of the BaseSegment 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(properties?: PropertySet);

Parameters

ParameterModifiersTypeDescription
propertiesoptionalPropertySet

Property Details

attribution

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

attribution?: IAttributionCollection<AttributionKey>;

Type: IAttributionCollection<AttributionKey>

cachedLength

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

cachedLength: number;

Type: number

properties

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

properties?: PropertySet;

Type: PropertySet

trackingCollection

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 trackingCollection: TrackingGroupCollection;

Type: TrackingGroupCollection

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

abstract readonly type: string;

Type: string

Method Details

addSerializedProps

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 addSerializedProps(jseg: IJSONSegment): void;

Parameters

ParameterTypeDescription
jsegIJSONSegment

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(other: ISegment): void;

Parameters

ParameterTypeDescription
otherISegment

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

abstract clone(): ISegment;

Returns

Return type: ISegment

cloneInto

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 cloneInto(b: ISegment): void;

Parameters

ParameterTypeDescription
bISegment

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 abstract createSplitSegmentAt(pos: number): BaseSegment | undefined;

Parameters

ParameterTypeDescription
posnumber

Returns

Return type: BaseSegment | undefined

hasProperty

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

hasProperty(key: string): boolean;

Parameters

ParameterTypeDescription
keystring

Returns

Return type: boolean

isLeaf

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

isLeaf(): this is ISegment;

Returns

Return type: this is ISegment

splitAt

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

splitAt(pos: number): ISegment | undefined;

Parameters

ParameterTypeDescription
posnumber

Returns

Return type: ISegment | undefined

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

abstract toJSONObject(): any;

Returns

Return type: any