SharedSequence Class

Packages > @fluidframework/sequence > SharedSequence

Signature:

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

Extends: SharedSegmentSequence<SubSequence<T>>

Constructors

List of constructors for this class
Constructor Modifiers Description
(constructor)(document, id, attributes, specToSegment) Constructs a new instance of the SharedSequence class

Properties

List of properties for this class
Property Modifiers Type Description
id string

Methods

List of methods on this class
Method Modifiers Description
getItemCount() Returns the total count of items in the sequence
getItems(start, end) Gets the items in the specified range
insert(pos, items, props)
remove(start, end)

Constructors

SharedSequence.(constructor)

Constructs a new instance of the SharedSequence class

Signature:

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

Parameters

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

Properties

id

Signature:

id: string;

Methods

getItemCount

Returns the total count of items in the sequence

Signature:

getItemCount(): number;

Returns:

number

getItems

Gets the items in the specified range

Signature:

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

Parameters

List of parameters
Parameter Type Description
start number The inclusive start of the range
end number The exclusive end of the range

Returns:

T[]

insert

Signature:

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

Parameters

List of parameters
Parameter Type Description
pos number The position to insert the items at.
items T[] The items to insert.
props PropertySet Optional. Properties to set on the inserted items.

Returns:

void

remove

Signature:

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

Parameters

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

Returns:

void