Typeberry by Fluffy Labs - v0.4.0
    Preparing search index...

    Interface ImmutableSortedSet<V>

    interface ImmutableSortedSet<V> {
        get array(): readonly V[];
        get comparator(): Comparator<V>;
        get length(): number;
        "[iterator]"(): Iterator<V, any, any>;
        findExact(v: V): V | undefined;
        findIndex(v: V): number;
        has(v: V): boolean;
        slice(start?: number, end?: number): V[];
    }

    Type Parameters

    • V

    Hierarchy (View Summary)

    Implemented by

    Index

    Accessors

    Methods

    • Returns Iterator<V, any, any>

    • Return the exact (in terms of comparator) element that's in the array if present.

      Note this API might look redundant on a first glance, but it really depends on the comparator. We might have a complex object inside the array, yet the comparator will consider two objects equal just by looking at the id. With this API we are able to retrieve the exact object that's stored.

      Parameters

      Returns V | undefined