An iterable implementation of vector that stores its content on the trie. Uses the following map: index -> element

Type Parameters

  • DataType

Hierarchy

Constructors

Properties

length: number = 0

The initial length of the collection. By default 0.

prefix: string

The byte prefix to use when storing elements inside this collection.

Methods

  • Get the data stored at the provided index.

    Parameters

    • index: number

      The index at which to look for the data.

    • Optional options: Omit<GetOptions<DataType>, "serializer">

      Options for retrieving the data.

    Returns DataType

  • Replaces the data stored at the provided index with the provided data and returns the previously stored data.

    Parameters

    • index: number

      The index at which to replace the data.

    • element: DataType

      The data to replace with.

    • Optional options: GetOptions<DataType>

      Options for retrieving and storing the data.

    Returns DataType

  • Removes an element from the vector and returns it in serialized form. The removed element is replaced by the last element of the vector. Does not preserve ordering, but is O(1).

    Parameters

    • index: number

      The index at which to remove the element.

    • Optional options: GetOptions<DataType>

      Options for retrieving and storing the data.

    Returns DataType

Generated using TypeDoc