rx-datatable API
    Preparing search index...

    Interface ISetF<K>

    An interface for a functional set, in which the set object could be read-only but new versions of the set can be created by calling "with" or "without" methods to add or remove keys. This is a subinterface of IMapF<K,V>, so the items in the set may be referred to as "keys".

    interface ISetF<K = any> {
        size: number;
        filter(
            callback: (k: K, v: any, counter: number) => boolean,
            returnThisIfUnchanged?: boolean,
        ): ISetF<K>;
        has(key: K): boolean;
        keys(): IterableIterator<K>;
        with(key: K): ISetF<K>;
        withKeys(keys: K[], returnThisIfUnchanged?: boolean): ISetF<K>;
        without(key: K): ISetF<K>;
        withoutKeys(keys: K[], returnThisIfUnchanged?: boolean): ISetF<K>;
    }

    Type Parameters

    • K = any

    Hierarchy (View Summary)

    Index
    size: number

    Returns the number of key/value pairs in the map object.

    • Returns a copy of the tree with items removed whenever the callback function returns false.

      Parameters

      • callback: (k: K, v: any, counter: number) => boolean

        A function to call for each item in the set. The second parameter to callback exists because ISetF is a subinterface of IMapF. If the object is a map, v is the value associated with the key, otherwise v could be undefined or another copy of the third parameter (counter).

      • OptionalreturnThisIfUnchanged: boolean

      Returns ISetF<K>

    • Returns a boolean asserting whether the key exists in the map object or not.

      Parameters

      • key: K

      Returns boolean

    • Returns a new iterator for iterating the items in the set (the order is implementation-dependent).

      Returns IterableIterator<K>

    • Returns a copy of the set with the specified key included.

      Parameters

      • key: K

      Returns ISetF<K>

      You might wonder why this method accepts only one key instead of ...keys: K[]. The reason is that the derived interface IMapF expects the second parameter to be a value. Therefore withKeys() is provided to set multiple keys at once.

    • Returns a copy of the tree with all the keys in the specified array present.

      Parameters

      • keys: K[]

        The keys to add.

      • OptionalreturnThisIfUnchanged: boolean

        If true, the method returns this when all of the keys are already present in the collection. The default value may be true or false depending on the concrete implementation of the interface (in BTree, the default is false.)

      Returns ISetF<K>

    • Returns a copy of the tree with all the keys in the specified array removed.

      Parameters

      • keys: K[]
      • OptionalreturnThisIfUnchanged: boolean

      Returns ISetF<K>