SharedSequence Class
Packages > @fluidframework/sequence > SharedSequence
Signature:
export declare class SharedSequence<T> extends SharedSegmentSequence<SubSequence<T>>
Extends: SharedSegmentSequence<SubSequence<T>>
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(document, id, attributes, specToSegment) | Constructs a new instance of the SharedSequence class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
id | string |
Methods
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
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
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
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
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