Skip to main content
Version: v1

SharedSequence Class

Signature​

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

Extends: SharedSegmentSequence<SubSequence

Type Parameters​

ParameterDescription
T

Constructors​

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

Properties​

PropertyTypeDescription
idstring

Methods​

MethodReturn TypeDescription
getItemCount()numberReturns 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​

ParameterTypeDescription
documentIFluidDataStoreRuntime
idstring
attributesIChannelAttributes
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​

ParameterModifiersTypeDescription
startnumberThe inclusive start of the range
endoptionalnumberThe exclusive end of the range

Returns​

Return type: Serializable<T>[]

insert​

Signature​

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

Parameters​

ParameterModifiersTypeDescription
posnumberThe position to insert the items at.
itemsSerializable<T>[]The items to insert.
propsoptionalPropertySetOptional. Properties to set on the inserted items.

remove​

Signature​

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

Parameters​

ParameterTypeDescription
startnumberThe inclusive start of the range to remove
endnumberThe exclusive end of the range to remove