Skip to main content
Version: v1

IOrderedCollection Interface

Ordered Collection interface

Collection of objects that has deterministic add and remove ordering. Object implementing this interface can be used as the data backing for the ConsensusOrderedCollection

Signature

export interface IOrderedCollection<T = any> extends ISnapshotable<T>

Extends: ISnapshotable

Type Parameters

Parameter Default Description
T any

Methods

Method Return Type Description
add(value) any Adds a value to the collection
remove() T Retrieves a value from the collection.
size() number Return the size of the collection

Method Details

add

Adds a value to the collection

Signature

add(value: T): any;

Parameters

Parameter Type Description
value T

Returns

Return type: any

remove

Retrieves a value from the collection.

Signature

remove(): T;

Returns

Return type: T

size

Return the size of the collection

Signature

size(): number;

Returns

Return type: number