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

ParameterDefaultDescription
Tany

Methods

MethodReturn TypeDescription
add(value)anyAdds a value to the collection
remove()TRetrieves a value from the collection.
size()numberReturn the size of the collection

Method Details

add

Adds a value to the collection

Signature

add(value: T): any;

Parameters

ParameterTypeDescription
valueT

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