rx-datatable API
    Preparing search index...

    Interface IMapF<K, V>

    An interface for a functional map, in which the map object could be read-only but new versions of the map can be created by calling "with" or "without" methods to add or remove keys or key-value pairs.

    interface IMapF<K = any, V = any> {
        size: number;
        entries(): IterableIterator<[K, V]>;
        filter(
            callback: (k: K, v: V, counter: number) => boolean,
            returnThisIfUnchanged?: boolean,
        ): IMapF<K, V>;
        forEach(
            callbackFn: (v: V, k: K, map: IMapSource<K, V>) => void,
            thisArg?: any,
        ): void;
        get(key: K): V | undefined;
        has(key: K): boolean;
        keys(): IterableIterator<K>;
        mapValues<R>(callback: (v: V, k: K, counter: number) => R): IMapF<K, R>;
        reduce<R>(
            callback: (
                previous: R,
                currentPair: [K, V],
                counter: number,
                tree: IMapF<K, V>,
            ) => R,
            initialValue: R,
        ): R;
        reduce<R>(
            callback: (
                previous: R | undefined,
                currentPair: [K, V],
                counter: number,
                tree: IMapF<K, V>,
            ) => R,
        ): R | undefined;
        values(): IterableIterator<V>;
        with(key: K): IMapF<K, V | undefined>;
        with<V2>(key: K, value: V2, overwrite?: boolean): IMapF<K, V | V2>;
        withKeys(
            keys: K[],
            returnThisIfUnchanged?: boolean,
        ): IMapF<K, V | undefined>;
        without(key: K): IMapF<K, V>;
        withoutKeys(keys: K[], returnThisIfUnchanged?: boolean): IMapF<K, V>;
        withPairs<V2>(pairs: [K, V | V2][], overwrite: boolean): IMapF<K, V | V2>;
    }

    Type Parameters

    • K = any
    • V = any

    Hierarchy (View Summary)

    Index
    size: number

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

    • Returns an iterator that provides all key-value pairs from the collection (as arrays of length 2).

      Returns IterableIterator<[K, V]>

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

      Parameters

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

      Returns IMapF<K, V>

    • Calls callbackFn once for each key-value pair present in the map object. The ES6 Map class sends the value to the callback before the key, so this interface must do likewise.

      Parameters

      • callbackFn: (v: V, k: K, map: IMapSource<K, V>) => void
      • OptionalthisArg: any

      Returns void

    • Returns the value associated to the key, or undefined if there is none.

      Parameters

      • key: K

      Returns V | undefined

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

      Parameters

      • key: K

      Returns boolean

    • Returns a copy of the tree with all values altered by a callback function.

      Type Parameters

      • R

      Parameters

      • callback: (v: V, k: K, counter: number) => R

      Returns IMapF<K, R>

    • Performs a reduce operation like the reduce method of Array. It is used to combine all pairs into a single value, or perform conversions.

      Type Parameters

      • R

      Parameters

      • callback: (previous: R, currentPair: [K, V], counter: number, tree: IMapF<K, V>) => R
      • initialValue: R

      Returns R

    • Performs a reduce operation like the reduce method of Array. It is used to combine all pairs into a single value, or perform conversions.

      Type Parameters

      • R

      Parameters

      • callback: (
            previous: R | undefined,
            currentPair: [K, V],
            counter: number,
            tree: IMapF<K, V>,
        ) => R

      Returns R | undefined

    • Returns a copy of the tree with the specified key set (the value is undefined).

      Parameters

      • key: K

      Returns IMapF<K, V | undefined>

    • Returns a copy of the tree with the specified key-value pair set.

      Type Parameters

      • V2

      Parameters

      • key: K
      • value: V2
      • Optionaloverwrite: boolean

      Returns IMapF<K, V | V2>

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

      Parameters

      • keys: K[]

        The keys to add. If a key is already present in the tree, neither the existing key nor the existing value is modified.

      • 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 IMapF<K, V | undefined>

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

      Parameters

      • keys: K[]
      • OptionalreturnThisIfUnchanged: boolean

      Returns IMapF<K, V>

    • Returns a copy of the tree with the specified key-value pairs set.

      Type Parameters

      • V2

      Parameters

      • pairs: [K, V | V2][]
      • overwrite: boolean

      Returns IMapF<K, V | V2>