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

Constructor Alerts Description
(constructor)(properties) Beta Constructs a new instance of the BaseSegment class

Properties

Property Alerts Modifiers Type Description
attribution Beta optional IAttributionCollection<AttributionKey>
cachedLength Beta number
properties Beta optional PropertySet
trackingCollection Beta readonly TrackingGroupCollection
type Beta readonly string

Methods

Method Alerts Return Type Description
addSerializedProps(jseg) Beta void
append(other) Beta void
canAppend(segment) Beta boolean
clone() Beta ISegment
cloneInto(b) Beta void
createSplitSegmentAt(pos) Beta BaseSegment | undefined
hasProperty(key) Beta boolean
isLeaf() Beta this is ISegment
splitAt(pos) Beta ISegment | undefined
toJSONObject() Beta any

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

Parameter Modifiers Type Description
properties optional PropertySet

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

Parameter Type Description
jseg IJSONSegment

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

Parameter Type Description
other ISegment

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
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

Parameter Type Description
b ISegment

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

Parameter Type Description
pos number

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

Parameter Type Description
key string

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

Parameter Type Description
pos number

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