Skip to main content
Version: v1

SharedSequence Class

Signature

export declare class SharedSequence<T> extends SharedSegmentSequence<SubSequence<T>>

Extends: SharedSegmentSequence<SubSequence

Type Parameters

Parameter Description
T

Constructors

Constructor Description
(constructor)(document, id, attributes, specToSegment) Constructs a new instance of the SharedSequence class

Properties

Property Type Description
id string

Methods

Method Return Type Description
getItemCount() number Returns the total count of items in the sequence
getItems(start, end) Serializable<T>[] Gets the items in the specified range
insert(pos, items, props) void
remove(start, end) void

Constructor Details

(constructor)

Constructs a new instance of the SharedSequence class

Signature

constructor(document: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes, specToSegment: (spec: IJSONSegment) => ISegment);

Parameters

Parameter Type Description
document IFluidDataStoreRuntime
id string
attributes IChannelAttributes
specToSegment (spec: IJSONSegment) => ISegment

Property Details

id

Signature

id: string;

Type: string

Method Details

getItemCount

Returns the total count of items in the sequence

Signature

getItemCount(): number;

Returns

Return type: number

getItems

Gets the items in the specified range

Signature

getItems(start: number, end?: number): Serializable<T>[];

Parameters

Parameter Modifiers Type Description
start number The inclusive start of the range
end optional number The exclusive end of the range

Returns

Return type: Serializable<T>[]

insert

Signature

insert(pos: number, items: Serializable<T>[], props?: PropertySet): void;

Parameters

Parameter Modifiers Type Description
pos number The position to insert the items at.
items Serializable<T>[] The items to insert.
props optional PropertySet Optional. Properties to set on the inserted items.

remove

Signature

remove(start: number, end: number): void;

Parameters

Parameter Type Description
start number The inclusive start of the range to remove
end number The exclusive end of the range to remove